Simple ~50% dutycycle frequency doubler idea

Started by ~arph, March 06, 2013, 11:26:49 AM

Previous topic - Next topic

~arph

This is a simple low parts count idea for a frequency doubler.

The idea is to use an XOR doubler, with a tuned filter on one input to keep the output duty cycle near 50% over the entire intput frequency range
To do this we take the output of one XOR frequency doubler, which has a narrow pulse of fixed width for each frequency on rising and falling edges, which of course over a variable frequency resembles a PWM signal.. this PWM signal is used to drive a LED/LDR combo. With the LDR as the resistor in the LFP in a second XOR doubler on the same input signal... with careful tuning it should be possible to get a reasonable 50% duty cycle over the full input range. On problem I foresee is nonlinearity in the LED/LDR combo.

Think it'll float?

schematic:

https://dl.dropbox.com/u/1849818/published_images/50_50-frequency-doubler.png

jonasx26

Would probably be very difficult to tune. Hm..
How about adding a comparator between the RC-delay and XOR input? Then use the proportional-to-frequency-PWM signal from the second XOR to shift the comparator threshold voltage.
As frequency increases the comparator threshold would decrease, making the XOR trigger even though RC-delayed signal amplitude changes over frequency.. 
A similar but alternative approach. Could work, maybe?

~arph

Yeah that comparator idea is nice too, might be a bit harder to tweak as the treshold voltage needs to be filtered more to get a decent stable DC. (it goes up with frequency right?, but for comparing that does not matter much)  With a LED/LDR combo the low reaction time of the LDR smoothes out the filter too. The added comparator will add another IC to the mix and that makes it more complicated. I mean we can also just get the LM2907 for $1.50 at futurlec and be done with a single IC.

Btw, the cool thing is that if it flies, we can use the two surplus XOR stages from the IC, with RC filters (on the same LED) to create +2 and +3 octaves.

jonasx26

Yes, PWM'd voltage should increase with frequency. And no, it doesn't matter as it probably would need offset and scaling before comparing anyway. That is another quad op amp. I'm not very good at keeping the parts count low  :)

Sure, needs more filtering but at least the comparator threshold voltage would be linearly related to input frequency.
Just as required RC-delay (/comparator threshold) is linearly related to input frequency.. (Related; http://www.maximintegrated.com/app-notes/index.mvp/id/3327)

BUT vactrol resistance as a function of current is something more like f(x)=1/ax^b .. To make it work well the vactrol would have to be kept within a fairly linear region, which means limited range.
Would surely be cool if it indeed flied as is. Which it might. Don't really know. Probably easier just to breadboard and see what happens  :D

~arph

Yeah low parts count is a must, I mean you could just rebuild the internals of that F-V chip too  :icon_mrgreen:
The vactrol resistance only has to vary about 25k, the scaling for the octaves can be done by selecting the right capacitor. So I think we might be fairly safe here.. I'm not aiming for 100% perfect 50/50 duty cycle either, just something close. so we can divide it down (by an odd number) and still have a reasonable signal.
I'm also considering a JFET (or a optocoupler like the H11F1) as variable resistor, but that is more sensitive to ripple.

DDD

Wow, it's a good idea. Very exciting idea!
Some serious research work will be necessary, of course.
Too old to rock'n'roll, too young to die

~arph

Yeah, that's why I threw it out here, as I don't have a lot of time.  :icon_sad:

DDD

That's why I published link to this topic on the best Russian DIY guitar electronics forum.  ;)
Too old to rock'n'roll, too young to die

~arph


jonasx26

Quote from: ~arph on March 07, 2013, 06:47:52 AM
Yeah low parts count is a must, I mean you could just rebuild the internals of that F-V chip too  :icon_mrgreen:
:icon_redface:

Quote from: ~arph on March 07, 2013, 06:47:52 AM
The vactrol resistance only has to vary about 25k, the scaling for the octaves can be done by selecting the right capacitor. So I think we might be fairly safe here.. I'm not aiming for 100% perfect 50/50 duty cycle either, just something close. so we can divide it down (by an odd number) and still have a reasonable signal.
I'm also considering a JFET (or a optocoupler like the H11F1) as variable resistor, but that is more sensitive to ripple.
Might just be that I'm way too picky and skeptical   ;) 
If the simple "original" circuit (like Tim Escobedo's Stupid CMOS Tricks) performs well enough for guitar, the improved 'tracking' from your mod should surely be worth the extra parts..
But I'm pretty sure you'll need a buffer between the LPF and LED. And maybe trimmers or at least some kind of offset for setting quiescent led current etc. Also, increase the R for less ripple and a happier 4070 chip.

~arph

skeptical is good

I agree on the buffer before the LED, however, you do have a bit of control over the minimum brightness by means of tuning the RC filter for the LED driver.
I'm not too worried about the XOR being unhappy.. It should be capable of driving that LED just fine. I believe that if we increase the R at the output of the LED driver we limit the max LED brightness.

It's all theory now.
I think the breadboard and a scope will give us some initial answers. First we have to see if the crude F-V conversion works, then try to interface that with the RC delay for the duty cycle control.


jonasx26

I'm pretty sure the F-V conversion will work with a sine wave input.
Thin pulses (filtered voltage low) at lower frequencies and about 50/50 duty cycle (filtered voltage near VCC/2) when the input frequency is "in tune" with the XOR RC time constant..
Question is, does it work with a guitar signal? Hmm.

~arph

Not directly I guess. My intent was not to drive it with a guitar signal, but with a heavy preconditioned squared up version of the guitar signal. But this is the case for all frequency tracking circuits.

jonasx26

Haha. Wow. Don't know what I was thinking. That's sleep deprivation for you..
Of course it will be a square wave input. Guess what I was getting at is a signal that changes in frequency.
But the vactrol itself will provide some lag, as you said..

And the fundamental-extraction is another issue entirely. Which I've struggled with quite a lot for my PLL octaver project.
So far I've got best results with a combination of feedback/forward-compression and low pass filtering of different frequencies:
INPUT > Gain > AGC/Compressor > LPF > AGC/Compressor > LPF > "OC-2"-style fund. extract.
Tracking is very good and consistent, no "dead frets". But it gets extremely complex.. Lots of parts.
Merlin's U-boat seems like a viable alternative to the common peak detect + window comparator circuit. Haven't tried it yet though.

~arph

If you google for XOR frequency doubler you'll find patents that come close to your comparator idea. What strikes me most is that most of those patents or designs out there are for a fixed frequency. The deal here is that I want it to work over the whole fretboard range. (and a few octaves up preferably).

I might be able to drag this onto the breadboard this weekend. See how it goes.

Lurco

How about XOR-doubling twice, then flipflopping the outcome of that, giving the double original frequency at 50% ?

R.G.

I thrashed through this at some length in the past.

The problem is that what you get out of an XOR doubler has the right number of edges, but not the right spacing for re-doubling. Simple XOR doublers give you one pulse per zero-crossing, but the width of the pulse is unrelated to the original signal frequency. If you try to double it again, you get a pulse train that's the right number of pulses for two-octaves-up, but they're in the wrong places for dividing in a flipflop to give you a cleanish octave up from them.

What you *can* do is to phase lock to either the original signal or to the XOR-doubled signal and generate another octave up and divide that down. Or two or three octaves up, for that matter.

The original signal size and harmonic content get into the issue too. You have to clean up the original signal to guarantee one zero crossing per cycle, and you have to gate the octave generation somehow so that you mute the spurious PLL outputs when the signal is too low at the input to generate proper musical-sounding signals. This is a common problem with the F-V approach too. You have to clean up the input signal and decide when the generated signal is musically valid.

It's tough. The simple circuits aren't good, and the good circuits aren't simple. There were people other than me as well looking at this as far back as the 70s.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

~arph

#17
Quote from: R.G. on March 08, 2013, 04:37:35 PM

The problem is that what you get out of an XOR doubler has the right number of edges, but not the right spacing for re-doubling. Simple XOR doublers give you one pulse per zero-crossing, but the width of the pulse is unrelated to the original signal frequency. If you try to double it again, you get a pulse train that's the right number of pulses for two-octaves-up, but they're in the wrong places for dividing in a flipflop to give you a cleanish octave up from them.


Exactly, it will only work if the output of the first XOR is 50/50. And this is just the case for a single frequency, depending on the RC delay.  That is why I proposed to have the RC delay depend on the input frequency, so we have a 50/50 output and stages can be cascaded.


R.G.

I tried but could never get that careful tuning right. But then I have not tried in a long time, either.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

~arph

Good to know that. I don't suspect to get it right either  :-[