Square LFO filtering

Started by ricothetroll, March 31, 2012, 06:46:58 AM

Previous topic - Next topic

ricothetroll

Hi,

I'm implementing Electric Druid's Tap LFO on my recently built MFOS subcommander. To proceed the PWM -> analog conversion, I put a triple RC filter (330R-1u-330R-1u-330R-1u). This corresponds to a FC of 90Hz. It seems quite low but still satisfying to my ears, I first experimented with 1kHz and the reduced the Fc by increasing the caps. But I still hear the LFO ticking pretty loud with the "brutal transitions" waveforms (ramp, square, random...). Taking a look at the filtered waveform with my scope, I can see that for the square signal, one side of the "cliff" is rounded, and the other stays sharp. I understand that it actually makes sense and corresponds to the charging/discharging of the filtering capacitors.

Is there a way to have soft transitions on both sides of the waveform ? What I'd like to achieve is something like a sine/tri signal through a diode clipping network (R + 2x diodes to gnd).

Maybe I'm just dreaming of something impossible...

Best regards.

Eric

ricothetroll

#1
Here's an illustration of the filtered squarewave :


By ricothetroll at 2012-03-31

CynicalMan

For a triangle wave, you want a 1-pole low-pass filter with a much lower Fc. I'd use an Fc of at most half your LFO's frequency. Try a 10k/4.7uF filter for the 10Hz signal in your sim.

PRR

It is a LOW frequency oscillator. I'd think you'd want the low-pass below 16Hz, not 90Hz. As Alex says, you may need to go much lower to really round-off the sharpness.

Also depending on source and load, 330r may be too low for good driving. Alex's 10K+4.7u may be good trial values.
  • SUPPORTER

ricothetroll

Hi,

Thanx for your answers !

Filtering with a lower Fc could help me getting rid of the ticking, but I'd like to keep the square nature of the LFO ! The goal is to have a multiple waveform LFO, who will modulate the VCF and the VCA of the MFOS subcommander. If I filter too low everything will sound like a sine modulation !

Here's an illustration of the kind of result I'd like to obtain, compared to the RC filtered square :



V(diode) keeps the "squarish" nature, with quite abrupt transitions between a low value and a high value, but both its edges are soft and so I guess the generate a lot less high harmonic that would feedthrough the output of the modulated circuit.

The only solution I see is to reprogram the uC with lookup table corresponding to this waveform, but I don't know if I'm willing to do it (won't have the time either...)

Any other idea ?  ::)

Best regards.

Eric

CynicalMan

Filter it to a triangle wave, amplify it, then clip it with the diodes.

merlinb

A standard triangle wave oscillator produces both square and triangle outputs. Clipping and filtering the triangle will also make a reasonable sinewave. Much easier than trying to filter a square wave...

ricothetroll

#7
Hi,
I tried with a 4 pole Bessel filter and got some better results ! I'd like to keep the tap LFO because of the tap tempo option and also because the RANDOM mode sound soooo cool with the VCF, similar to Maestro FSH-1 (this mode also does tick at the output).
I think I'll live with that for the moment...
Thanx again for your advices !
Best regards.
Eric
PS : Merlin, I own your book on guitar toob preamps, one of the best musical/electronics book I've ever read ! That's the book I was looking for, for years. It sits right next to Boscorelli's "Stompbox cookbook". Thanx a lot for sharing your knowledges, here and in your books. Is the power amp part planned yet ? I can't wait to read it !

ricothetroll

#8
For a reason I ignore, the word "t-u-b-e" is automatically replaced by the word "toob"... Maybe that comes with the new "girly" display... ::)

ElectricDruid

To curve the corners without damaging the 'square' shape, you need a filter with better rolloff. For that reason, the 4 pole bessel is a better option.
You can experiment with different values with the tool I originally used to design it. Inevitably, the design is a compromise between clean sharp edges and smooth response. You may feel that a different balance of those parameters is more to your taste. Try it:

http://designtools.analog.com/dt/filter/filterW.html

Enjoy!

Tom

ricothetroll

Hi Tom,
Thanx for the link !
Best regards.
Eric

ElectricDruid

Thinking a bit more about the cascaded passive RC filter, I can see some improvements. If you look at this:

http://www.electronics-tutorials.ws/filter/filter_2.html

It suggests that to avoid each subsequent stage loading the previous one, the resistor values should increase x10, and the capacitor value should decrease to 1/10th.
This would mean that your 330R/1u x 3 filter would be better implemented as 33R/10u + 330R/1u + 3K3/100n. But that gives a very low impedance on the first stage. So maybe we should try 3K3/100n + 33K/10n + 330K/1n instead.

This filter should give a 18dB/oct response even with only 6 components. The result won't be as good as an active filter, but it might well be good enough, and it's too simple not to try.

Good luck!
Tom