Plot PCM output in Matlab (MP3 decoder) -


i doing mp3 decoder project , have built function decode song in mp3 format:

function [pcm_output,frequency] = decode(mp3song) 

at end of code, adding few lines plot pcm waveform:

t=0:0.01:120;  plot(t,pcm_output); title('pcm waveform'); 

but shows error:

vectors must same lengths.

how solve error? besides, possible output decoded song in pcm format?

additional question: want compare mp3 , pcm output shown in figures below: mp3 - amplitude vs time

pcm - amplitude vs time

why pcm has 2 output overlay together? because of left , right channel @ output?

if try plot sound wave, need t vector same length pcm_output. so, instead of t=0:0.01:120 need

t=linspace(0,120,length(pcm_output(1,:))); 

Comments