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

]]>The MA is no more or less recommended for the side-chain of the envelope follower than any other filter, its only a suggestion for use of a basically crappy LPF (for low orders). The audio detector has its own ballistics, so you could have a detector with a 1 second attack time and a 10 second decay time - the filter's latency or group delay won't mean anything in comparison with the detector's ballistics.

- Will

]]>