PWM compressor

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
zamproject said:
Hi all

What type of filter/integrator can be used to have a good attenuation at 100kHz if the cut off is around 20kHz ?
I mean we need about 100dB to extract all PW noise.

I just do some (online) calculation with 3d order Sallen-Key at Fc=20kHz, it only cut 40dB at 100kHz introducing up to 20uS delay

Best
Zam

Maybe run 2 Salen-Keys in series?  Another alternative would be a dedicated switched capacitor chip, but this would require another clock at a higher frequency.  I don't have the specs in front of me, but the required clock is something like 5 x fcutoff.    I think 20us is completely acceptable.  That is much faster than a typical attack time for a compressor.
 
Hi
20uS is ok for sidechain (not applicable anyway if it's a feed forward), I agree.
But here it's in the audio path, won't be 20uS (or 40uS if two filter in series) problematic for parallel compression ?
Happy phasing ;D
Best
Zam
 
MicDaddy said:
:D sounds like assembly time

Do you guys write in higher-level language with the micro-controllers?  I am limited to assembly

C always. The Keil 8051 C compiler is as good as it gets. And if you really have to, you can use assembly sources for critical things. I haven't found the need to do that ... in a very long time.

If you're doing ARM, you're wasting your time if you think you can do better than the compiler.
 
Andy Peters said:
C always. The Keil 8051 C compiler is as good as it gets. And if you really have to, you can use assembly sources for critical things. I haven't found the need to do that ... in a very long time.

If you're doing ARM, you're wasting your time if you think you can do better than the compiler.

I agree C is the way to go. Compilers are written by humans so the question is really can some guy write some general rules that will always lead to better assembler code than I can write? The answer is no.

Cheers

Ian
 
zamproject said:
Hi
20uS is ok for sidechain (not applicable anyway if it's a feed forward), I agree.
But here it's in the audio path, won't be 20uS (or 40uS if two filter in series) problematic for parallel compression ?
Happy phasing ;D
Best
Zam

Worst case scenario, 40uS at 20kHz gives you a 288 degree phase shift.  At 20Hz, a 0.289 degree shift.  So, this could be an issue!  Ok then.  How about some type of FIR filter?
 
usekgb said:
Worst case scenario, 40uS at 20kHz gives you a 288 degree phase shift.  At 20Hz, a 0.289 degree shift.  So, this could be an issue!  Ok then.  How about some type of FIR filter?
FIR filters, contrary to common belief, are not zero-phase. They have a non-negociable delay, resulting in comb-filtering when recombined with the original signal. It would be possible to insert an identical filter in the direct path.
OTOH, an 8th-order B'worth filter would provide the required rejection, but would introduce severe phase-shift, resulting in comb-filtering in teh audio spectrum.
 
So, if we wanted to use this for parallel compression, the feature would have to be built in.  Apply the same low-pass FIR filter to the clean channel(s) and to the compressed channel(s).  Blend the two to taste.  :)
 
usekgb said:
So, if we wanted to use this for parallel compression, the feature would have to be built in.  Apply the same low-pass FIR filter to the clean channel(s) and to the compressed channel(s).  Blend the two to taste.  :)
Do you know how to design an FIR filter in analog?
 
abbey road d enfer said:
Do you know how to design an FIR filter in analog?

No idea.  Is it even possible?  Going back to Ian's suggestion of a switched capacitor filter, there are some ready made LPF solutions by TI, AD, etc that appear to have similar responses to FIR filters.  I have not looked at the time delays in these, and they require a clock input that is several times fs.  I will be unable to look in to it today, as I am on a show all day.  Anyone want to take a look at them?
 
zamproject said:
Hi all
What type of filter/integrator can be used to have a good attenuation at 100kHz if the cut off is around 20kHz ?
2nd order should be good enough, 4th is being conservative. I like Bessel curves to minimize group delay as it's the most perceived distortion in filters but it does hurts the freq response specs.
I mean we need about 100dB to extract all PW noise.
  No you don't, as the maximum attenuation shouldn't be 100%, but the ~20dB you allow for maximum range the noise is already lower, that's one of the things about not over estimating the range, then there is the fact that the noise is over the useful band, so you just need enough to avoid aliasing at the input and at the output some smoothing so the out of band energy doesn't cause troubles in the next stage. (slew rate issues for instance) Then the actual HF noise till it gets to the speakers has plenty stages to be loose in action.
I just do some (online) calculation with 3d order Sallen-Key at Fc=20kHz, it only cut 40dB at 100kHz introducing up to 20uS delay

Best
Zam

  So the band of interest is 20kHz because we are audio noodles, and don't want to get over 50kHz as Rupert always wish. Then previous to the modulator we need to filter out anything that might bring problems to this. As the PWM freq is 100kHz, anything below 80kHz would mean a problem, we need an attenuation at 80kHz to get existing noise at 80kHz below (or equal to) the original noise at 20kHz. The signal we are starting with shouldn't have much content at 80kHz to start with. Let's account for a worst case broadband pink noise signal That's 12dB under the signal at 20kHz but even lower than the RMS signal, or the in band signal but the noise flor is flat. At 20kHz we are already 60dB under the 20Hz level, for 100dB dynamic range we need an attenuation at 80kHz of... 100dB-72dB=38dB, that's 2 octaves away from the frequency to conserve. There a 4th order filter is required. 

  I wouldn't expect such signal at the input and you have to account the input filtering of the device protecting from RFI and such, plus the compensation of the opamps, etc as filtering stages, In all of which you are probably loosing something at 80kHz. Then as I said I wouldn't expect to have that much signa at 80kHz to start nor be that worried of the S/N at 20kHz as lower in the band. So you can relax the filter specs a bit without worrying too much. Then there is the filter curve to choose, for better freq response specs Chebyshev filter gives the better figure to show in the paper but I don't like to hear filtered by Chebyshev filters. On the other extreme of the spectrum there are the Bessel filters which gives the worse freq response to show in paper but they are much nicer to listen to. Then there are many options in the middle to have a balance between them.  You need to figure out how much attenuation you want at 80kHz and how much you already have in the system. 38dB seems too conservative, I'd probably be happy with anything over 30dB. Then how much you allow to hurt the band, in amplitude response and group delay/phase.

  For the reconstruction it's even simpler, as you just need to limit the slew rate to a level to be close enough to the maximum expected signal slew rate. You don't need to allow rail to rail travel at max freq, slew rate figures for audio is another discussion but there are reference to go with or there's not so hard to come out with a figure. Then at 100kHz the travel will be half peak to peak minus the attenuation range (20dB max atten would give 0.45 max peak to peak level) and from there the numbers roll out.

  You need passive filtering for the first stage and then be able to manage the slew rate, so a faster opamp doing that filtering is a good idea. The stage after the filter should be fine and have some extra attenuation and subsequent stages shouldn't mean a problem. I'd spect 1st order passive plus 2nd order filter to be plenty enough.

JS
 
usekgb said:
Worst case scenario, 40uS at 20kHz gives you a 288 degree phase shift.  At 20Hz, a 0.289 degree shift.  So, this could be an issue!  Ok then.  How about some type of FIR filter?

I am unclear what the problem is here. A delay is not a problem for the audio in the audio path.

Cheers

Ian
 
usekgb said:
So, if we wanted to use this for parallel compression, the feature would have to be built in.  Apply the same low-pass FIR filter to the clean channel(s) and to the compressed channel(s).  Blend the two to taste.  :)

I have never quite understood the attraction of paralel compression.

Cheers

Ian
 
ruffrecords said:
I am unclear what the problem is here. A delay is not a problem for the audio in the audio path.


Cheers

Ian

The question came up about using this for parallel compression.  In this application, the frequency dependent phase shift would become an issue.
 
ruffrecords said:
I have never quite understood the attraction of paralel compression.

Cheers

Ian

It facilitates not having to make a decision.
 
desol said:
It facilitates not having to make a decision.

LOL.  It freaks out the younger live engineers that have never used an analog desk when I can get "that" drum sound live.  They can't figure out how to do it on their SC48.
 
ruffrecords said:
I have never quite understood the attraction of paralel compression.

Cheers

Ian
It's a way of compressing drums without compressing them whilst still compressing them (or not).
Sounds much better if you rename it New York compression.  :-[
 
  One of the things parallel compression does is to limit the compression range, somewhat similar to older gear, not able to do 40dB attenuation, which the ratio would taper off, or the I/O curve would regain 1:1 slope after some attenuation. That's for slow response, for fast response it allows to play around with things you can't do with single compression. I'd like to do parallel compression in the choir or filling voices, to gain some clarity while not perturbing the balance. Very aggressive compression to allow just transients to get out, and then some of the unprocessed signal to fill the voids.

  Maybe having a range knob in compressors (as in gates) could help avoid parallel compression and have a similar effect, without the phase shifting problem. Using a µC also allows to play quite a lot with the side chain timing so would be a much more flexible to allow mad things, as the GML triple timing (dual RMS+peak) and even implement some hysteresis like some low distortion limiters.
  Note that this range control isn't about the actual circuit but could be implemented in software, not like the max range I said about the cell it self. This could work just limiting the PWM to a minimum duty cycle or added a fancy curve to be more realistic.

JS
 
I am probably missing something but it seems to me that parallel compression is actually rather limited. If it involves mixing an original signal with a compressed one, then, if the two signals are equal when there is no compression the overall signal level is just 6dB higher. When the compressor works, the gain reduction is simply limited to a maximum of 6dB.

Cheers

Ian
 
Back
Top