Thank you for this amazing book!

]]>My mistake was simply a typo in the variable names - it is easy to mistype and create positive feedback.

The GS Oscillator as it is in the book does output sine waves ranging -1/+1 perfectly!

]]>**W Pirkle said **

Yes, you can grab them here:

http://willpirkle.com/Download......6.0.1.zip

Note that these require the legacy version of RackAFX6. I will add this link to that download page as well.

WillÂ Â Â

Thanks. My 2nd edition has arrived, but I haven't read it yet. So still using 1st edition examples for now.

]]>http://willpirkle.com/Download......6.0.1.zip

Note that these require the legacy version of RackAFX6. I will add this link to that download page as well.

WillÂ

]]>Â

So, I could achieve the desired HPF by implementing an LPF and subtracting its output from the original signal. Something like:

Â

Yout = Xin - Ylpf

Â

Could there be a simpler solution to the desired filter?

]]>A 1st order HPF, analog or digital, necessarily requires a zero at DC to pull the DC response all the way down to nothing at 0Hz. The one-pole HPF does not have this zero and therefore will never be able to do much more than make a bit of a LF shelf.Â

I should note that Figure 6.2 is erroneous. It was not supposed to go along with the one-pole LPF. It was supposed to go with the 1st order BZT LPF instead (I'm working on a new edition that fixes this). The one-pole LPF does not have a zero at Nyquist so its response is actually closer to that of an analog filter. Likewise, the one-pole HPF does not have a zero at DC that it requires. Both of those are actually very early audio filter designs and in my new edition I am actually omitting the HPF version as it doesn't have that required zero.

- Will

]]>I've implemnted the LPF example on p.164-5 and recevied a satisfactory result, i.e. zero (db) gain at low frequencies and (-6 db) attenuation slope at higher than cutoff frequencies.

However, when I implement the HPF example, I get a high-frequency attenuation which is not the expected with some energy loss at low frequncies.

When dialing in the HPF values, I was expecting a zero (dB) gain at high frequencies and -6 db attenuation slope at sub-cutoff frequencies. That' s not what I receive on the FR graph. What am I doing wrong ?

**Here is the code:**

**//Design equation calculation (Fc = 100, Fs = 44100, Pi = 3.14159 approx.)**

*float Theta = 2 * 3.14159 * 100 / 44100;*

* float T = 2 - cos(Theta);*

* float b1 = sqrt(T*T - 1) - T;*

* float a0 = 1 + b1;*

Â

**//Turn stereo to mono (just for convinience and simplicity)**

*float x = 0.5 * (pInputBuffer[1] + pInputBuffer[0]);*

Â

**//Difference equation**

*float y = a0 * x - b1 * yn;*

Â

**//Iterate**

yn = y;

Â

**//Output**

*pOutputBuffer[0] = y;*

* pOutputBuffer[1] = y;*

*return true;*

=====================

Yn is declared as float in the *.h file and zero'd on 'prepare to play' function. It does work for LPF...

]]>Both the Optimal Method and Frequency Sampling method code originally came from a great DSP book called "Digital Signal Processing: A Practical Approach" by Ifeachor and Jervis and it is listed int the Bibliography of the FIR and IIR chapters in the FX book. I just coded in C++ the algorithms they describe so well, and they also provide some raw C code as well. They also describe and show the implementation for the Windowing method (a third and very popular method to generate FIR filters). My version is their first edition, published in 1993 (and I still use it today) - but there are newer versions out there.Â

The only tricky thing with the Optimal Method is the Remez Exchange Algorithm and I used a very old (but stable) version you can get here:

https://github.com/AE9RB/firpm/blob/master/remez.c

Hope that helps,

Will

]]>I didn't know about impulse response generator in RackFX - pre-computing my filter coefficients should be a big help.

Â

I'm just wondering how I could do the process of generating the impulse responses from inside my code, rather than using RackFX to do this outside of my code?Â

I would prefer to be able to generate impulse responses for a low pass filter from inside my code, but with a sample rate argument that would cause the impulse responses to re-generate if the sampling rate changes (or if other parts of my code require the filter to work at an arbitrary oversampling rate).Â Â

Would this be reasonably possible?Â Â

]]>http://www.willpirkle.com/app-.....polyphase/

This uses the "textbook" linear phase FIR filters which are decomposed into smaller polyphase filters. If you want to do it correctly, this is the way to go. The major hurdle is convolution with the long FIR filters, even after making them more efficient (see the App Note).

You may also find papers on using IIR filters instead and there are also some "budget" versions that I've run across, but never got too interested in.

You might also want to check the code for the VCV Rack synth plugins which (if I remember correctly) includes some oversampling code.Â

Hope that helps,

- WillÂ

]]>I've been trying to tackle the problem of aliasing, and I have a question about low pass filtering as part of my method, which I will try to explain...

**1)** I have to do oversampling (by a factor of 'm') in my synthesis calculations so that the effective Nyquist limit is much higher than the host sample rate Nyquist limit.Â Â

Â Â This prevents high frequencies from aliasing.

**2)** I have to low pass filter the oversampled signal, so that when I downsample back to host sample rate there will be no frequency content above the host Nyquist limit.

**3)** Lastly I downsample by summing every (mth) sample, and then dividing this sum by 'm'.Â

Â Â For example, if I am using x8 oversampling, I will sum together 8 samples and divide the result by 8 to get my final sample output at the host sample rate.Â Â

I'm relatively new to filter theory and coding filters, so I opted to borrow some code from the 'ResonantLPF' RackFX project.Â Â

Specifically, I have borrowed the Biquad object from the RackFX example code to do my low pass filtering at stage **2)**.Â Â

This prototype anti-aliasing system works in basic way, although it is computationally expensive and does not prevent aliasing perfectly.

So my question is... **what sort of filter (as opposed to the 'ResonantLPF') would be ideal for improving this anti-aliasing process?Â Â **

Is there anything else in the FX book that I could turn my attention to?Â **Â **

- Will

]]>**Quadrature Phase outputs**

Â

Can anyone supply a brief explanation to this topic? I couldn't get it out from Wikipedia or the web.

Â

Appreciated

]]>