View Single Post
  #50   Report Post  
Posted to alt.binaries.schematics.electronic
ian field[_2_] ian field[_2_] is offline
external usenet poster
 
Posts: 800
Default Sample & hold - for frequency.


"Michael A. Terrell" wrote in message
m...

ian field wrote:

"John Fields" wrote in message
...
On Sat, 7 Nov 2009 14:21:25 -0000, "ian field"
wrote:


"John Fields" wrote in message
. ..
On Fri, 6 Nov 2009 21:57:44 -0000, "ian field"
wrote:


"Jim Thompson" wrote
in
message news On Fri, 6 Nov 2009 20:53:53 -0000, "ian field"
wrote:


"John Fields" wrote in message
newskg8f55tfc1tkddh584hpp5aagshbcnlf4@4ax. com...
On Fri, 6 Nov 2009 14:53:26 -0000, "ian field"
wrote:


"John Fields" wrote in message
news:gop6f598hqid0qo3aag5bkbdoa5b0391n3@4a x.com...

Assuming that your mic can integrate out the 12kHz transitions
and
yield
a harmonic and overtone-free fundamental, what I'd do would be
to
detect
sequential zero crossings of the signal, square them up with a
comparator, and use the time between the edges to allow a
counter
chain
to accumulate high frequency clocks (the frequency of the clock
chosen
to force the regenerated signal (the "copy") to yield the
accuracy
you
need) then, at the end of that time, to latch that value and
send
the
output of the latch to the broadside load inputs of the counter
chain.

Simultaneously, the counter chain's count direction will be
changed,
making it a down counter, and when it gets to zero it'll clock
a
dflop
wired as a divide-by-two, and will also reload the value stored
in
the
latch into the counter, starting the cycle anew.

The net result will be that the output frequency of the
divide-by-two
will mimic the output frequency of the synthesizer.

JF

I was hoping for something pretty minimalist - its a sort of one
hit
project
that once its given me the info I want, its likely to get robbed
of
parts
for later projects.

---
Well, you're going to need, as a minimum, something which you can
use
to
measure the period of the waveform and then read it out and take
its
reciprocal.

That could be something as simple as a comparator, a dflop, an RS
flip-flop, a clock source, and a counter feeding some LEDs

Just for grins, let's say the highest frequency you can get out
of
the
organ is 3520 Hz (A7) and you want to measure the frequency to
+/-
1%.

In order to do that you'll need a clock running 100 times faster,
which
is 352000 Hz., and something to accumulate 100 clock cycles
during
one
3520 Hz. cycle; an 8 bit binary up counter.

So what you'd do would be to manually reset the counter, have the
first
rising edge of the squared-up organ signal enable the counter,
and
the
next rising edge disable it forever.

Then you'd get the contents of the counter by reading the LEDs,
and
the
frequency of the organ signal by multiplying the counter's
contents
by
284.0909µs and taking the reciprocal of the product.

One thing to be aware of is that as the frequency of the organ
signal
decreases, either the length of the counter will have to increase
or
the
frequency of the clock decrease in order to prevent overflow.

Finally, it could get tricky trying to catch the first real
rising
edge
of the organ signal, so what I'd do would be to insert a small
(10ms?)
delay from the whatever the rising thing out of mic was and, when
it
timed out, use the next 2 rising edges to gate the counter,


JF

Can't I just make a PLL lock on to the frequency and stay put after
the
note
has decayed, then measure the frequency with a digital frequency
counter?


A PLL that doesn't drift once it loses reference ?:-)

It only needs to stay put for just over a second to cover the gate
time
of
the counter.

---
But, once you hit the note, the PLL has to lock on to the signal
coming
from the mic and, once that's happened, you've got to make your
frequency measurement, which means the VCO has to lock in in whatever
time's left in the front end of envelope so the counter can get a
good
count.

One thing that will definitely help is if you square up the signal
coming from the mic, which will effectively put some sustain in it
and
increase the time you'll have useful input into the PLL and the
counter.

Also, if you can play the key legato so that the leading edge of one
envelope falls on the trailing edge of the previous one before the
amplitude decays to the point where the PLL and counter lose it, that
might work.

Hell, if you can do it that way you might just be able to get away
with
a counter and a comparator!

But then you won't get to use my beautyful circuit :-( sob...

Its a shame, but I can't afford my own power station to run it all.

---
What are you talking about?

You can do the whole thing for probably less than than $10 in parts and
less than a quarter of a watt in power.

And, it seems to work:


Version 4
SHEET 1 2520 948
WIRE 448 96 176 96
WIRE 736 96 464 96
WIRE 1024 96 752 96


snip

What are all those numbers?



You've never heard of LT spice? Switchercad 3?


Pretty sure I've downloaded them at some point, just not had time to install
them and have a play.