3 or 4 octave up square wave ??

Started by markusw, November 04, 2005, 06:48:58 AM

Previous topic - Next topic

gez

Quote from: jmusser on November 05, 2005, 08:14:59 AM
It's really odd I've never seen this circuit, but then again

Hardly surprising as it's not posted anywhere...though people can do what they want with it (just text book stuff really).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Thanks gez!

So the (one) preferred way would be "gain stage - compression - gating (with a monostable)- squaring -PLL" ?

Could you please give me a hint (link) on that monostable gating or even better direct me to a schem :) ?


Quote from: Paul Perry (Frostwave) on November 04, 2005, 09:52:27 AM
use a phase locked loop, but the time taken to acquire lock is the problem there.

How will this problem affect the performance??

Markus

gez

#22
QuoteSo the (one) preferred way would be "gain stage - compression - gating (with a monostable)- squaring -PLL" ?

Simple way is:

Gain stage (to square up signal) - sine to square converter (or in this case square to even squarer!) - PLL

Or

Buffer (possibly with slight gain) - compressor - sine to square - PLL

The gating is done as a side chain.   The advantage of the second approach is that your envelope follower can be used to control both the compressor and the VCA to gate the thing.  But, as mentioned in my previous post, it sounds like turning down the volume on a hi-fi rather than the natural decay of a note.  I prefer to just cut the note off just short of its natural splutter point, so you get more of a synthy effect (no dynamics).

QuoteCould you please give me a hint (link) on that monostable gating or even better direct me to a schem :) ?

Re the monostable, I’ve probably got something in my files somewhere.  Give me a little time to dig something up and I’ll post it…



"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

QuoteBut, as mentioned in my previous post, it sounds like turning down the volume on a hi-fi rather than the natural decay of a note.  I prefer to just cut the note off just short of its natural splutter point, so you get more of a synthy effect (no dynamics).

I think I like the idea of a synthy effect. Should be OK in combination with the passive ring mod.

So the scheme would be: buffer/gain stage - optional 18 dB/octave filter - compressor - sine to square converter - PLL; +/- the monostable stage to cut off the spluttering.

QuoteRe the monostable, I’ve probably got something in my files somewhere.  Give me a little time to dig something up and I’ll post it…

Would be great. Thanks a lot!

This will be a great project for me even if it's not working the way I wan't because there's so much to learn!

Markus

gez

#24


The values chosen are based on back of envelope calculations and will probably need tweaking to suit.

The 4098 is a dual monostable.  Only one half is used here, some of the pin connections for the second device are tied to V+ or ground so if you want to use the second half you’ll need to consult the data sheet (best to anyway in case I’ve made a mistake drawing this up).

Trimpot of comparator is set slightly below bias on -ve input (best to use stop resistors too - I'm lazy!).  It sets the threshold at which the comparator stops supplying positive-edge square waves to the input of the monostable.  The 4098 as wired is retriggerable and pin 7 will be at ground for as long as an input signal is applied to pin 4 of the chip.  Once the comparator stops supplying pulses the monostable will keep pin 7 low for a further period of RC seconds (determined by the 100k resistor, 1M pot and the 4u7 cap) then go high, disabling the 4046.  This means you can set a reasonably high threshold for the comparator so avoiding miss-triggering/splutter.  I didn’t make a note of values in my note book (there’s irony for you) so you’ll need to mess around with increasing/decreasing the 4u7 cap and/or resistors.

If I recall, using the enable pin of the 4046 might have given a ‘pingy’ sound upon cut-off…but don’t quote me on that. If this is the case then feed the 4046 output to one input of a dual input logic gate set up as a buffer (loads of choices) and tie the other gate to one of the outputs of the 4098 (each device in the chip has non-inverting and inverting outputs) to disable it.

QuoteSo the scheme would be: buffer/gain stage - optional 18 dB/octave filter - compressor - sine to square converter - PLL; +/- the monostable stage to cut off the spluttering.
Yup.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Hi Gez,

thanks a lot for the gate schem!
I will browse through the data sheets and application notes to get a better a idea how the 4046 and 4098 work.

Quotebest to use stop resistors too
To avoid having V+ or gnd at the +in ?

QuoteIf this is the case then feed the 4046 output to one input of a dual input logic gate set up as a buffer (loads of choices)
Sorry, dual logic gate setup as buffer ?? Any hint  :icon_redface:

Markus

gez

#26
QuoteTo avoid having V+ or gnd at the +in ?

Yes (unless the amp allows this sort of abuse).  With stop resistors:

From V+ to Ground, resistor - trimpot - resistor. 

The total resistance of the last two being equal to the resistance of the first resistor (or thereabout).  It makes adjustment less fiddly.  As shown will work fine though.  Once you’ve tweaked it to get the threshold you want measure the resistance and use a two resistor divider to bias the comparator.

QuoteSorry, dual logic gate setup as buffer ?? Any hint

Many two input logic gates function as either inverting or non-inverting buffers when one of the inputs is tied to one of the rails (which one depends upon your choice of gate) and the signal (your square wave) is applied to the other input.  For example (and this is only one of many options), a NAND gate (eg. 4011 or 4093 chips) with one input ‘high’ (tied to V+) will invert the signal applied to the other input.  If the input tied to V+ is then taken ‘low’ (ground) the output goes high and stays high regardless of what the other input does - it’s ‘disabled’.  Rather than tie one input permanently to one of the rails and switch it mechanically, it gets tied to the one of the outputs of the 4098 - the one that is low when no input signal is applied and high when pulsed from the comparator.

Don Lancaster’s CMOS Cookbook has logic tables for all the gates.  It also has pinouts for most of the 4000 series, so it’s useful for that alone.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Thanks for your explanations. The picture gets clearer :)

QuoteDon Lancaster’s CMOS Cookbook has logic tables for all the gates.  It also has pinouts for most of the 4000 series, so it’s useful for that alone.

Just ordered it.

One more Q re compression: which type do you think would be adequate? Optical, OTA based??

Markus


gez

Quote from: markusw on November 06, 2005, 06:16:13 AM

One more Q re compression: which type do you think would be adequate? Optical, OTA based??


It all depends on how complicated/simple you wish to make the circuit, or what it requires - no point in going overboard on this if it isn't required.  OTA would be appropriate if you could find another use for half a LM13700 for example. 

I'm afraid you're just going to have experiment with various circuits and decide for yourself...therein lies the fun!  :icon_smile:
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Quote..therein lies the fun

Thats true  :)

Quoteno point in going overboard on this if it isn't required

Will try to keep it  as simple as possible but still apropriate.

Thanks a lot for your help!

Markus

gez

Here's the Boss schematic I mentioned.  One of the few I can think of offhand that uses a 4046 for more than just the on-board oscillator.

http://www.freeinfosociety.com/electronics/schematics/audio/bossdf2.pdf

The Lancaster book will probably be easier to understand though.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Thanks for the schem! Next step for me will be quite some reading and trying to simulate the schems or parts of them with LTSpice.

Markus



markusw

One more Q regarding latency of the PLL. IIRC I read in one of the data sheets that it takes 2 cycles for the PLL to lock. 2 cycles for my low B string would be about 60 ms. Thats pretty long   :o

markus

gez

Quote from: markusw on November 09, 2005, 10:41:47 AM
One more Q regarding latency of the PLL. IIRC I read in one of the data sheets that it takes 2 cycles for the PLL to lock. 2 cycles for my low B string would be about 60 ms. Thats pretty long   


Never really been a problem for me but then I don’t play bass so I’m not in a position to comment. 

Think I might have made the RC constant a little too long in that schematic.  Was probably thinking of another circuit where I was sampling the input signal and then cutting it off.

You probably want a lot shorter time constant so the monostable disables the 4046 a split second after the comparator stops providing pulses to the 4098’s input.  The threshold for the comparator would therefore be set low and the time constant for the monostable would need to be just longer than one cycle of the lowest note on your instrument. 


"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

hi gez,

thanks for your continous help  :)

If I got it right reducing the RC constant of the 4098 would reduce the time the 4098 waits until turning off the 4046 (to avoid sputtering once the signal gets too weak).

But I'm less sure about the latency issue of the 4046 per se. Some more Q:
Is 2 cycles a reasonable value for locking of the 4046?
And is my calculation correct that if it takes the 4046 2 cycles to lock in it would be around 60 ms for the low B string swinging at ~30 Hz? Would be still 25 ms for the low E on guitar.
So I could expect the circuit to be in a "no signal" state because the 4098 disables the 4046 (i.e. also the 4046 VCO is off?). Once the squared guitar signal gets into the 4098 it turns on the 4046 which now starting with it's "center" freq (determined by the values of an external R/C combination)  trys to lock on to the freq of the input signal. So what I probaby would hear would be a signal starting at it's center frequency and sweeping more or less rapidly towards the lock freq? Could actually be a cool sound :) (if it's true).



Markus
  

gez

#35
QuoteIf I got it right reducing the RC constant of the 4098 would reduce the time the 4098 waits until turning off the 4046 (to avoid sputtering once the signal gets too weak).

Yeah, with the values given the thing will take seconds to turn off (I was thinking of a different circuit).

QuoteIs 2 cycles a reasonable value for locking of the 4046?
And is my calculation correct that if it takes the 4046 2 cycles to lock in it would be around 60 ms for the low B string swinging at ~30 Hz? Would be still 25 ms for the low E on guitar.

I’ve never really had a problem with latency as the oscillator kicks in immediately, it just doesn’t lock-in immediately so the first fraction of a second will/might be out of tune.  Will you notice this?  I don’t, but a lot depends on how fast you set the thing up to lock.

Out of interest where did you get the figure of 2 cycles?  If it’s correct (I have no idea) then at 30Hz it would take 67mS (rounded off), but there’s no significant time delay for the reason given above...famous last words! :^)

QuoteSo I could expect the circuit to be in a "no signal" state because the 4098 disables the 4046 (i.e. also the 4046 VCO is off?).

Provided the threshold of the comparator is reached the 4098 is ‘immediately’ triggered and the 4046 enabled.  There’ll be no gap between hitting a note and hearing it (well, nothing that your ears/brain will detect).

QuoteSo what I probaby would hear would be a signal starting at it's center frequency and sweeping more or less rapidly towards the lock freq? Could actually be a cool sound

If the PLL is slow to lock you can get gliss effects.  Not that cool if you ask me.  Can be a problem if you’re using a large divider with the PLL as the oscillator will have a large range.  Can also be a problem if your square wave is weak.  In such cases I’ve found that driving the sine to square converter with a strong signal really helps…that or compression.

You need to set the oscillator up so that it's off when in a quiescent state (only use one resistor for the oscillator).

PLLs aren’t perfect.  It’s possible to get good working circuits using them (I have), but you’re going to have to work at it and experiment.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

gez

Quote from: gez on November 09, 2005, 02:35:12 PMCan also be a problem if your square wave is weak. 

That should have read 'input signal is weak'.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

markusw

Quotebut you’re going to have to work at it and experiment

as you mentioned before...therein lies the fun  :)

QuoteOut of interest where did you get the figure of 2 cycles?

Unfortunately, I can't remember were I read it, but I will try to find it again.


QuoteCan also be a problem if your square wave is weak.  In such cases I’ve found that driving the sine to square converter with a strong signal really helps…that or compression.

I think I will try to include a compression stage.

Markus

Paul Perry (Frostwave)

If you run a square waave thru an integrator you get a triangle wave.
Then if you full-wave rectify the triangle, you get a triangle with double the frequency (if the biassing is right). Which if you then overamplify, gives you a square wave.. at twice the freq of the original one. Practical? maybe, maybe not.

jmusser

I had approached this awhile back, with wanting to do 2 octaves up, and supposedly, this was a very difficult thing to do. It seems that this is right, because I haven't seen an arm load of circuits that do this. I would like be able to separate the individual octaves and play at lets say 3 octaves up, and then 2 or 4, or a blend of all 4. If I could do this, would my ears actually be able to make out the difference between the different up octave like they can down octaves? I have heard the sound sample for instance of the ZVEX Johnny Octave, and could really couldn't tell there was ever a second octave happening. I believe that yes, he has achieved this, and he is to be commended, but I am expecting to hear something at about dog frequency, and maybe, it's just not perceptable.
Homer: "Mr. Burns, you're the richest man I know"            Mr. Burns: Yes Homer It's true... but I'd give it all up today, for a little more".