I am doing a mp3 decoder project and I have built a function to decode a song in mp3 format:
function [PCM_output,frequency] = decode(mp3song)
At the end of the code, I am adding a few lines to plot the PCM waveform:
t=0:0.01:120;
plot(t,PCM_output);
title('PCM waveform');
But it shows error:
Vectors must be the same lengths.
How to solve the error? Besides, is it possible to output the decoded song in PCM format?
Additional Question: I want to compare the mp3 and PCM output as shown in the Figures below: MP3 - Amplitude vs Time
Why does the PCM has two output overlay together? Is it because of the left and right channel at the output?