Rob
Rob

Reputation: 1885

Extract signal from mp3 using multimedia file block in Simulink

I have a multimedia file block in Simulink, and I'm using it to play out of my speakers. It's working fine, but I'm wondering if there's a way to extract the signal in MATLAB using get_param or something similar. I want to plot the entire signal on a GUI, so I need to have the entire signal before I play it.

Upvotes: 0

Views: 1605

Answers (2)

Rob
Rob

Reputation: 1885

I ended up using a dsp.AudioFileReader to read my song. Not even bothering with the from Multimedia File, because I don't know how to get the entire signal from that quickly (it outputs at the sampling rate, I wanted to plot the signal before playing the song).

I created a while loop and stepped through the dsp.AudioFileReader quickly enough and then played my song through the multimedia block.

Upvotes: 1

Sam Roberts
Sam Roberts

Reputation: 24127

Can you connect your multimedia block to a 'To File' or a 'To Workspace' block? That would save the signal to a file that you could later load in, or directly to a workspace variable. You could then plot it, or incorporate it into your GUI, within MATLAB.

Upvotes: 0

Related Questions