June 9, 2015
Love the book but kind of stumped on this one. I hesitate to post here because I know it should be easy to figure out, but after scratching my head for far too long I've given up.
The implementation that I've coded yields what seems to be a different frequency response graph than the one posted in Figure 6.3. My frequency response bottoms out around -23dB at nyquist (22.5kHz) at 1kHZ corner frequency. The graph in Figure 6.3 seems to plummet much further however. Here's the code that I have in the process function:
float theta_c = 2.0 * pi * m_fCornerFreq / (float) m_fSampFreq;
float y = 2.0 - cos(theta_c);
float b1 = sqrt(y * y - 1.0) - y;
float a0 = 1.0 + b1;
float xn = pInputBuffer;
float yn = a0 * xn - b1 * m_f_Yz1;
pOutputBuffer = yn;
m_f_Yz1 = yn;
Note that m_fCornerFreq is set to 1000.
Here's a quick screen grab of the graph that I'm getting:
January 29, 2017
Wow - you are the first to report this and you are indeed correct. The book figures are incorrect! Your response is the correct one for this filter.
I will add this to the list of stuff to fix or the second edition of the book (not coming out any time soon, but eventually will need to correct this).
Thanks for pointing this out to me!
All the best,
Most Users Ever Online: 36
Currently Browsing this Page:
Guest Posters: 1
Newest Members:Matt, dspstudent, strings4v, TheSmile, semihyavuzz, alfredLue, danioc, midnightskate3, Alia5, Shamal Sundar
Moderators: W Pirkle: 208
Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 208