FIR Filter delay for Realtime Signal Processing

조회 수: 4 (최근 30일)
Ghazian Ghaffar Amna
Ghazian Ghaffar Amna 2021년 5월 6일
댓글: Ghazian Ghaffar Amna 2021년 5월 27일
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 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