News:

SMF for DIYStompboxes.com!

Main Menu

1-bit compressor

Started by earthtonesaudio, December 21, 2010, 04:24:19 PM

Previous topic - Next topic

earthtonesaudio

UNVERIFIED, but I plan to try this out when I have time. 




The clock should be very fast and roughly a square wave.  About 1MHz should be fine.  Lower clock speeds may introduce weird digital artifacts, which I'm interested in trying.  If I can get away with it, I want to try and use a quad op-amp for the in/out sections as well as the remaining clock circuitry, so that the whole thing can be done with just 3 ICs.

I'm not very clear on whether this is adaptive delta modulation or sigma-delta modulation, but it's something along those lines.

Taylor

Um, I totally get what you've got going on here, but I have a dumb friend who is a little baffled. Could you briefly explain to... my dumb friend what's happening in this circuit?  ;D

The audio gets turned into a pulse stream of some sort, which switches the compression pot on and off at high speed in a PWM fashion, and the pot is controlling opamp gain since the whole middle section is in the opamp's feedback loop? Am I in the ballpark?

Gurner

It looks to me that there is a mistake on the polarity pins of the first opamp ...that opamp has been set to work as a non inverting opamp (with the resistance in the feedback loop controlling the gain), but the input is showing going into the -ve input pin. Also I reckon the junction of the two resistors should be connected to theinverting pin (makes this difficult to explain when the pins in the diagram are wrong!)

The second opamp looks correct, but if (as I suspect) that the first opamp should be non inverting, then the overall circuit is inverting - which isnt a good thing from a convention perspective.

JKowalski

I have absolutely no clue what you are trying to do. Explanation?

What is the D pin on the 4017?


amptramp

The exclusive OR output goes high if the inputs are different and low if they are the same.  They are always different in this circuit.  Something must be amiss in the schematic.

JKowalski

Its not always different - the 4017 is a counter so the D0 and D1 outputs continuously cycle as

D0 D1 XOR
0   0   0
0   1   1
1   0   1
1   1   0
0   0   0
0   1   1
1   0   1
1   1   0
etc.

I don't know what the D pin is though so I have no idea where to start. Is it the reset pin?


merlinb

Quote from: JKowalski on December 21, 2010, 09:29:29 PM
Its not always different - the 4017 is a counter so the D0 and D1 outputs continuously cycle as

I don't know what the D pin is though so I have no idea where to start. Is it the reset pin?
I think that's a typo; I think it's meant to be a CD4013. The circuit is a simple A-to-D converter (followed by a D-to-A converter, which is the second opamp integrator).
However, I think there may be a further error in the schema, because it appears that the XOR gate will be permanently delivering a '1' to the analogue switch, since its inputs are tied to both Q0 and Q1...

Or maybe I've completely missed the point...

JKowalski

Quote from: merlinb on December 22, 2010, 05:29:17 AM
Quote from: JKowalski on December 21, 2010, 09:29:29 PM
Its not always different - the 4017 is a counter so the D0 and D1 outputs continuously cycle as

I don't know what the D pin is though so I have no idea where to start. Is it the reset pin?
I think that's a typo; I think it's meant to be a CD4013. The circuit is a simple A-to-D converter (followed by a D-to-A converter, which is the second opamp integrator).
However, I think there may be a further error in the schema, because it appears that the XOR gate will be permanently delivering a '1' to the analogue switch, since its inputs are tied to both Q0 and Q1...

Or maybe I've completely missed the point...

Ah yeah thats probably right. D0 and D1 are kind of odd labels to use for inverted outputs though.

Earthtones, explain yourself! We are bashing our heads against the wall


earthtonesaudio

#8
Eh, I was too hasty with that drawing.  Should have done a bit closer reading and there are several mistakes.  Please don't bash your heads on my account!   ;D

First and most egregious: yes 4017 is a typo.  I meant it to be a 4015, but you could actually use a 4013 also.  Whatever chip is used, it should be wired as a serial-in/parallel-out static shift register.  So data on the D input is latched to Q0 on the rising edge of the clock, then shifted to Q1 on the falling edge of the clock.  If D is the same for two clock cycles, the XOR closes the switch.

Second, while the input differential amplifier is supposed to be a comparator, not an op-amp, the inputs are indeed backwards anyway.   :P



What the circuit should do:

The signal is compared to the voltage on the capacitor and makes a logic high or low at the D input based on that difference.  Current flows through the "compression" pot and limiting resistor to cause the capacitor voltage to ramp towards the signal voltage.  Once it ramps far enough, the D input changes state.  If the input signal is not changing, then the cap will be charged and discharged at roughly a 50% duty cycle.

If the input signal is increasing then the cap has to charge to a higher level to reach equilibrium, so you'll get two or more successive 1's out of the shift register, which will turn on the XOR and close the analog switch.  This bypasses some of the "compression" pot and allows the cap to charge more rapidly.  

The digital output goes into a lossy integrator which performs the D-A conversion, but still allows some digital hash to be heard.

Corrected typos:


[edit]Just found this article which helps explain the ADC/DAC portion with a similar circuit.

Hides-His-Eyes

Could the circuit work in falstad if a crude tremolo was used to show the effect of different signal strengths?

JKowalski

Quote from: Hides-His-Eyes on December 22, 2010, 12:36:48 PM
Could the circuit work in falstad if a crude tremolo was used to show the effect of different signal strengths?

Just use the frequency sweep in falstad's sim and put it through a filter of some sort to get frequency dependent amplitude.

earthtonesaudio

Just discovered another error in my schematic.  In the section describing how to make an XOR from two SPDT analog switches, the first switch section is shorting the supply to ground.  Instead it should be presenting the next switch section with either +V or GND. 

Hides-His-Eyes

has anyone built this yet?

earthtonesaudio

Quote from: Hides-His-Eyes on December 28, 2010, 06:35:45 AM
has anyone built this yet?

I just breadboarded a "working" version of this.  Had to swap in a 4027 wired as a D-flop because I was out of 4013s.  I used a TL074 for the comparator, integrator, and a hysteresis oscillator (one amp unused).  I won't know what frequency it's running until I dig my scope out of the closet.  The audio output sounds pretty bad, just square waves.  I don't know if that's because of the values I used or if I made a wiring error.  There's a lot of wire so that's entirely possible.
Currently the compression pot has some effect on the amount of treble content.  I'm going to keep working on it for a while.