4
$\begingroup$

Problem: I'm trying to analyze the behavior of an FIR filter with the following impulse response/kernel: Impulse Response

Using Matlab's function grpdelay(myKernel,length(myKernel)), I obtained the following figure:

Group Delay

Based on my limited knowledge the graph is not correct since it contains negative values. Is my understanding correct? If it is, how could I go about obtaining a more accurate group delay graph?

Code:

    onePulseRun20 = dlmread("C:\Users\agusfrpa\Pictures\singlePulseRun20.txt");
twoPulseRun21 = dlmread("C:\Users\agusfrpa\Pictures\twoPulseRun21.txt");
%twoPulseRun22 = dlmread("C:\Users\agusfrpa\Pictures\twoPulseRun22.txt");

%y is averaged one pulse data
y = mean(onePulseRun20,1);
pulse = twoPulseRun21(1,:);

myFilter = conj(fft(y))./(abs(fft(y)).^2+.3);
myKernel = real(ifft(myFilter));
myKernel = myKernel(4700:5250);

grpdelay(myKernel, length(myKernel));

I will post the link for data in the comments.

$\endgroup$
4
  • $\begingroup$ Data files: link and link $\endgroup$ Commented Jul 25, 2017 at 22:22
  • $\begingroup$ You should read that I think : dsprelated.com/showarticle/69.php . I'm not sure you can use grpdelay() the way you are $\endgroup$
    – Florent
    Commented Jul 25, 2017 at 23:13
  • $\begingroup$ The group delay of a causal filter can become negative. If your impulse response and the corresponding group delay graph make sense is a different question, but the fact that the group delay is negative is no reason to conclude that the graph doesn't make sense. $\endgroup$
    – Matt L.
    Commented Jul 26, 2017 at 7:49
  • $\begingroup$ The group delay can be negative at some frequencies but not always negative. See here and here $\endgroup$
    – ZR Han
    Commented Apr 7, 2021 at 6:55

1 Answer 1

1
$\begingroup$

Does the impulse response of the FIR filter you've shown need to be reversed along the sample axis (i.e. horizontal axis)?

$\endgroup$
6
  • $\begingroup$ Kind of. Both the pulse data and the kernel are reflected across the x axis. I could reflect both of them to make it more intuitive but it would result in the same output. $\endgroup$ Commented Jul 25, 2017 at 22:51
  • $\begingroup$ Perhaps you could post your datafiles online (and provide a link) and clarify the procedure you used to generate the recorded impulse response. $\endgroup$
    – Michael_RW
    Commented Jul 26, 2017 at 0:30
  • $\begingroup$ The datafiles are here: link and link. The impulse response was obtained with the code posted in the question. I basically got data of what the pulse should look like and time reversed it, thus making a matching filter. Let me know if you that is not enough information. $\endgroup$ Commented Jul 26, 2017 at 4:22
  • $\begingroup$ What is the sample rate of the collected data? What was the signal used to generate the system's impulse response? Can you post that also? $\endgroup$
    – Michael_RW
    Commented Jul 26, 2017 at 13:19
  • $\begingroup$ The sample rate is 8GHz. The impulse response was obtained by time reversing data of a single pulse, thus effectively making a template of what my pulse should look like. If I then convolve the unfiltered data with the template we get a matching filter. Does that answer your question? If not, let me know and I'll try again. I am new to DSP so there's a lot I need to learn, so please bear with me. $\endgroup$ Commented Jul 26, 2017 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.