-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransferFunction.FrequencyResponse return half sided spectrum + 1 (Nyquist + 1) #15
Comments
Oh and the for index in GroupDelay should start at 0, I think... otherwise you will get a peak in the last index. |
No, it's not a bug; it's just how I've implemented GD. The reason for Group delay, by definition, is the derivative (see Wikipedia, for example). It can be naively implemented like here: group_delay = -diff(unwrap(angle(h))) / diff(w)
a = [5, 6, 7, 8, 9]
diff(a)
# returns [1, 1, 1, 1] Essentially, we're just excluding zero frequency element from computations, that's why the length is smaller by 1, i.e. PS. In fact, the implementation is slightly more difficult - see here, but the 'derivative thing' is the same. |
Yes. The half-sided spectrum is clear. But why + 1? Look/debug into the result for e.g. Bessel:
For me the last number (4) looks strange... |
I've already explained why +1 (see my previous answer). Seems like you're asking about the group delay that has size |
Well, according to Rick Lyons:
So for better results for IIR filters I'll check out the Shpak algorithm... |
OK thank you. I understand now |
Quite possible )) |
I've written a complete analog of sciPy |
While review and learning the code from the TransferFunction class, I wonder why FrequencyResponse returns a half-sided spectrum + 1 (Nyquist + 1), but, for example, GroupDelay not. Is there a reason or is it a bug?
FrequencyResponse:
real.Take(length / 2 + 1)
GroupDelay:
var gd = new double[fftSize / 2];
The text was updated successfully, but these errors were encountered: