Recovering SampleRate from 'From Mutimedia File " Block in simulink

2 views (last 30 days)
I- As part of a mini project on sound processing. As students, we were asked to create a mixer consisting of two parts:
part 1: equalizer
part2: audio effect
II-In the equalizer part:
-the input signal must be recovered with the component 'from multimedia file'block
-Subsequently I must be able to divide it into filter bands using several filters
c-The equalizer works very well for filters with fixed frequencies
III-In order to improve the latter, I decide to add a "MATLAB Function" block which will aim to create a set of variables that will be used later like the cutoff frequencies of the filters depending on the sampling frequency (if it is less than or greater than or equal to 20KHz)
My problem is as follows: how to retrieve the sampling frequency from the 'From MultiMedia File ' Block in order to use it in the variables ?
N.B: -I have attached the simulink block diagram and a sketch of my "Magic Function"
Thank you in advance for your help !

Answers (1)

jibrahim
jibrahim on 19 Jan 2021
Hi Younes,
One way to do this is with a probe block. Use a probe fo get the port sample time and dimensions. You get the sample rate by dividing the singal length by the sample time. The selector blocks are used to pick up the first element from each output port of the probe

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!