Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Problem by first order LPF
No permission to create posts
September 17, 2014
3:15 am
Forum Posts: 12
Member Since:
September 2, 2014
sp_UserOfflineSmall Offline

I implemented the single pole filter for first-order LPF (book chapter 6, page 164).

The difference equation is as follows:
y(n) = a0*x(n) - b1*y(n-1)

I tried to get the same frequency response as in page 166, so I used 1kHz as fc and 8000 as fs (Input Sample Rate in my Setup Audio Devices) and used the LPF equation from page 165.

At the end I got this equation:
y(n) = 0.013614*x(n) - (-0.986386)*y(n-1)

The problem is, I didn't get the same response as in page 166. Here is the result from my implementation in linear and log:
http://imagizer.imageshack.us/v2/xq90/538/LW0HwV.pngImage Enlargerhttp://imagizer.imageshack.us/v2/xq90/673/DlrEAN.pngImage Enlarger

Is there anything wrong with my calculation?

September 17, 2014
9:07 pm
Forum Posts: 12
Member Since:
September 2, 2014
sp_UserOfflineSmall Offline

Also for the next filter which is Simple Resonator, I tried to get the response like in Figure 6.6 (book page 168), but instead of it, I got a low pass filter with steeper attenuation
T29v5K.pngImage Enlarger

Here is my difference equation:
yn = xn*0.00314 - yn_1* (-1.92132) - yn_2* (0.92446525)

is there anything wrong with my calculation?

And.. one more thing. I also found something odd in page 176 equation 6.20 about how to calculate the pre-warped analog cutoff, it says that the analog frequency result = 0.07136, but it supposes to be the result inside the "tan", the complete result must be tan(0.07136) = 0.00124. Is it typo? Thank you for your help!

September 20, 2014
5:55 pm
W Pirkle
Forum Posts: 249
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

Hi Derza:

For your filter questions: first, the "Input Sample Rate" setting is for the audio input, meaning line/microphone input. RackAFX can process audio through your line-in as well as via a .wav file. So setting the input rate to 8kHz doesn't do anything. The second way that you can get audio into your plug-in is via a .wav file. In this case, the sample rate is set to the .wav file's rate (and delivered to your plugin during the prepareForPlay() function call).

However, when you use the Analyzer to take the frequency, impulse, step or phase response, the sample rate is fixed at 44.1kHz. So you need to use that as the fs if you are going to be using the analyzer to make comparisons with calculations. If you look at the analyzer graphs you will see Nyquist at 22kHz, not 4kHz as it would be with fs = 8kHz. If you open the analyzer controls, you will see at the right that you can't change the sample rate (you can when using the FIR Designer module).

However, if you used a .wav file with fs = 8kHz as input, your filter should work properly and sound correct.

Another tool that you can use to check your calculations at fs = 8kHz is the set of built-in Modules. The ones named "Multifilter" and "HP/LP Filter" implement many of the basic filtering algorithms in the book. There is a Block Diagram button (or View->Block Diagram) that will show you the calculated coefficients for a given filter. The coefficients are calculated using the sample rate of the .WAV file you have loaded. As you move the controls around, you can watch how the coefficients change. It shows that for most IIR filters, changing one control changes all (or nearly all) of the coefficients. So, you can load a 8kHz wav file and use the HP/LP module to check your calculations. NOTE: If you change the wav file to a new fs with these modules loaded, you must first move a control around to see the coeffs update.

As for your question about Eq. 6.20, there is no typo. The analog frequency is 0.07136 and it follows Eq . 6.14 exactly.

- All the best,


Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Peter: 41

Frodson: 40

clau_ste: 39

Gwen: 32

JimmyM: 30

TheSmile: 27

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 523

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 546

Posts: 2138

Newest Members:

rawbirdtoe, Bill, hill william, NAUN_SONAR, sufy, Diane, Richard, drvenkman, venkman, Jfx

Moderators: W Pirkle: 249

Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 249