FIR Filter delay for Realtime Signal Processing

2 ビュー (過去 30 日間)
Ghazian Ghaffar Amna
Ghazian Ghaffar Amna 2021 年 5 月 6 日
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
Christopher McCausland 2021 年 5 月 26 日
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
Ghazian Ghaffar Amna 2021 年 5 月 27 日
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 Center および File ExchangeGet 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