FIR Filter delay for Realtime Signal Processing

4 次查看(过去 30 天)
Hello everyone, i am trying to simulate a realtime signal processing through simulink with all of these block in the picture below. Without the filter, it works fine. But as soon as the filter is introduced we can see a big delay with only 501 filterkoef. Why is this happening ? What can i do to fix this delay ? As for the coefficients, i should be using an impuls where i recorded a clap in my room and then transfer it to matlab. but for the sake of testing i used this instead : filterkoef = [ zeros(1,500) 1 ].

回答(1 个)

Christopher McCausland
Hi Ghazian,
Your question is more about sampling theroy than matlab. Using an FIR filter will intorduce group delay to the signal. i.e. there is a delay from the signal entering the FIR filter to the signal being output. Group Delay can be calculated as:
Where N is the number of filter taps and T is the sampling time
Where N is the number of filter taps and T is the sampling time. Assuming a sample frequency of T is 20 Hz, the expected phase delay is 12.5 seconds provided the FIR filter is linear which is about what your image shows.
Are you sampling the signal at a sufficently high enough frequency, I would expect 48 khz or so?
Christopher
  1 个评论
Ghazian Ghaffar Amna
Hi Christopher,
yes i am sampling it at 44.1kHz so i think its already high enough.
as for delay, i asked around in reddit and someone found the answer.
its because the microphone process it in frame based and not sampled based.
and we can change that in the block setting of the microphone.
Ghazian

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with DSP System Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by