# Help understanding state variable filter working principle and phase relations

#### jacopo1919

Joined Apr 12, 2020
113
Hello!
I'm looking to the state variable filter proposed from ESP in Project 153 that is a state variable filter that splits the signal in 3 bands and sums them back together.
this should give a flat response all over the spectrum when the bands are summed back together.
I simulated the circuit with LTspice and the response looks flat as expected.

R5/R6/C1/C2 cutoff frequency is set at 2200Hz
R20/R21/C5/C6 cutoff frequency is set at 170Hz

However, if i run a triangle wave of 1Khz inside of the circuit i get this

and this if the frequency of the triangle is 400Hz

In fact, at the beginning i was expecting to see the same sharp triangle at the output but It looks like each one of the 3 bands have a different phase shift and when summed together at the end they won't recreate the original shape of the triangle.
This is a visible distorsion but the text (of the related project 148) says "couldn't measure the distortion as it's below my measurement threshold, and it sat resolutely at 0.02%".
Also, the amplitude of Vout is lower then Vin but in the AC analysis graph i read that Vout has almost 0dB change from 20Hz to 20Khz.

This doesn't happen if repeat simulation with a sinewave instead of a triangle. this, though, is an analog audio circuit and there aren't be pure sine waves in audio signals that will pass through the circuit.
With the sine wave, i get only phase shifting, starting with 0° at 600 Hz.

What i see from the simulation is probably going to sound bad or at least far from similar to the original input signal.
What am i missing?

#### Attachments

• 84.7 KB Views: 6

#### Papabravo

Joined Feb 24, 2006
21,258
You seem to have a fundamental misunderstanding of the frequency spectrum of various signals. You should do an FFT of a triangle wave at some frequency of interest – perhaps 440 Hz. Take a look at the harmonic content due to the discontinuity of the derivative at the peaks and valleys. When you run a triangle through a lowpass or bandpass filter that harmonic content will be attenuated. That attenuation will result in waveform distortion or lack of fidelity. Not sure why you would be surprised by this,

#### crutschow

Joined Mar 14, 2008
34,679
This doesn't happen if repeat simulation with a sinewave instead of a triangle. this, though, is an analog audio circuit and there aren't be pure sine waves in audio signals that will pass through the circuit.
True, but a normal audio signal can be broken into it's Fourier sine-wave components which go from about 20Hz to 20kHz..
A triangle-wave is never seen in an normal audio signal (so why would you use one for audio testing?), and has Fourier components well above 20Khz due the sharp breaks at the peaks of the waveform, thus you can't expect the triangle-wave to go through your filter without rounding of the peaks.

You need to understand what the Fourier components of your signal are.

#### Papabravo

Joined Feb 24, 2006
21,258
Triangle Wave 1220 Hz. - 6 cycles

Corresponding FFT - Notice all the odd harmonics 3rd, 5th, etc.

#### crutschow

Joined Mar 14, 2008
34,679
Corresponding FFT - Notice all the odd harmonics 3rd, 5th, etc.
And that those above the TS's filter HP rolloff will be attenuated, so the output sawtooth will not have those harmonics, causing rounded peaks.

#### jacopo1919

Joined Apr 12, 2020
113
You seem to have a fundamental misunderstanding of the frequency spectrum of various signals. You should do an FFT of a triangle wave at some frequency of interest – perhaps 440 Hz. Take a look at the harmonic content due to the discontinuity of the derivative at the peaks and valleys. When you run a triangle through a lowpass or bandpass filter that harmonic content will be attenuated. That attenuation will result in waveform distortion or lack of fidelity. Not sure why you would be surprised by this,
I understand that for each filter sections, some harmonic content (or fundamental) will be attenuated with Linkwitz-Riley response.
And If i consider each filter separately, i wouldn't be surprise that the waveform differs from the original.

But here the output of each filter is summed back together. and for this reason i expect that the signals of two contiguous bands (low/mid and mid/high) at same frequency get also summed back together, resulting in a "0dB change" and ideally bringing back the harmonic content.
And i thought so since the AC analysis was showing 0db change until 20Khz

True, but a normal audio signal can be broken into it's Fourier sine-wave components which go from about 20Hz to 20kHz..
A triangle-wave is never seen in an normal audio signal (so why would you use one for audio testing?), and has Fourier components well above 20Khz due the sharp breaks at the peaks of the waveform, thus you can't expect the triangle-wave to go through your filter without rounding of the peaks.

You need to understand what the Fourier components of your signal are.
I'm sending the triangle to analyse and trying to understand what is going on here (that is the reason of the post itself)
But isn't the High Pass band keep sharp edges/high frequency harmonic content? the circuit sums all bands at the end and i expect them to be present in the final sum.
Why that high frequency content is not present in the sum?

#### jacopo1919

Joined Apr 12, 2020
113
And that those above the TS's filter HP rolloff will be attenuated, so the output sawtooth will not have those harmonics, causing rounded peaks.
what "TS" stands for?
isn't the LP filter attenuating the content above the cutoff point?

#### Papabravo

Joined Feb 24, 2006
21,258
I understand that for each filter sections, some harmonic content (or fundamental) will be attenuated with Linkwitz-Riley response.
And If i consider each filter separately, i wouldn't be surprise that the waveform differs from the original.

But here the output of each filter is summed back together. and for this reason i expect that the signals of two contiguous bands (low/mid and mid/high) at same frequency get also summed back together, resulting in a "0dB change" and ideally bringing back the harmonic content.
And i thought so since the AC analysis was showing 0db change until 20Khz

I'm sending the triangle to analyse and trying to understand what is going on here (that is the reason of the post itself)
But isn't the High Pass band keep sharp edges/high frequency harmonic content? the circuit sums all bands at the end and i expect them to be present in the final sum.
Why that high frequency content is not present in the sum?
The problem is that once you lose the information due to attenuation AND phase shift, the supposed reconstruction by summation is unable to reproduce the original input by undoing the attenuation but adding additional phase shift.

ETA: since you did not show us your schematic, we have no idea what opamps you used. That choice might have a dramatic effect on the results.

#### crutschow

Joined Mar 14, 2008
34,679

#### jacopo1919

Joined Apr 12, 2020
113
The problem is that once you lose the information due to attenuation AND phase shift, the supposed reconstruction by summation is unable to reproduce the original input by undoing the attenuation but adding additional phase shift.

ETA: since you did not show us your schematic, we have no idea what opamps you used. That choice might have a dramatic effect on the results.
the original schematic from ESP is linked in the first post.
My simulation is also attached in the first post (a bit hidden from the other images.
Here again:
i naively used some TL072 powered with +- 12V.

#### Papabravo

Joined Feb 24, 2006
21,258
the original schematic from ESP is linked in the first post.
My simulation is also attached in the first post (a bit hidden from the other images.
Here again:
View attachment 318578i naively used some TL072 powered with +- 12V.
You're right, I did miss that.

#### jacopo1919

Joined Apr 12, 2020
113
based on @Papabravo said, the the supposed reconstruction wouldn't work because there would be additional extra phase shift. So, maybe is there a way to rotate again the phase of each band of the same amount in the opposite direction in order to correct this?
or is there another approach that can mitigate it?
I can only think of all pass filters but if I'm not wrong, they are operating equally over all the frequency

#### crutschow

Joined Mar 14, 2008
34,679
So why is this "reconstruction" of the signal so important to you?

#### jacopo1919

Joined Apr 12, 2020
113
The project requires to split the signal in 3 bands, been able to attenuate them separately at wish (artistical expression of Dj or musicians), then sum them back together and send them to an audio amplifier.
3 pots are used to attenuate of each band (in my schematic I use R11/R12,R13/R14,R15/R16 as simple voltage dividers to mimic the potentiometers) and when they are kept in the middle position they sum the 3 signals recreating the original audio signal with 0dB change over all the audible spectrum (in the LTspice simulation i have used 2 5k6 in order to mimic the middle point of a ~10k potentiometer).
So i look for the least distortion at the end of the circuit.
The core of this circuit is a 3-way Linkwitz-Riley electronic crossover

#### crutschow

Joined Mar 14, 2008
34,679
So i look for the least distortion at the end of the circuit.
Phase-distortion is generally not audible.