DSPRelated.com
Forums

Detectiong CW

Started by John E. Hadstate March 1, 2006
What's the slickest way of turning an I/Q data stream, tuned 
to baseband, into audible Morse Code with user-selectable 
pitch using strictly digital signal processing?



John E. Hadstate wrote:
> What's the slickest way of turning an I/Q data stream, tuned > to baseband, into audible Morse Code with user-selectable > pitch using strictly digital signal processing?
Shift it up or down by the selected pitch. That requires a tunable quadrature audio oscillator, two multiplications, and an addition if the picture in my head is correct. I just thought of a slicker way. Discard one of I or Q, and use the other's presence or absence to turn an oscillator on and off. Filter the gated output to remove clicks on transitions. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
"Jerry Avins" <jya@ieee.org> wrote in message 
news:SeSdnaXPwKPe7ZvZRVn-iA@rcn.net...
> John E. Hadstate wrote: >> What's the slickest way of turning an I/Q data stream, >> tuned to baseband, into audible Morse Code with >> user-selectable pitch using strictly digital signal >> processing? > > Shift it up or down by the selected pitch. That requires a > tunable quadrature audio oscillator, two multiplications, > and an addition if the picture in my head is correct.
That's what I thought. Basically, my oscillator generates I/Q components at the desired audio frequency (amplitude 0.5 units). I add a bias of 0.5 to each component and multiply the result by the pre-detected incoming signal, effectively 100% amplitude modulating the keyed carrier. After running it through the AM detector, I thought I should have a usable keyed audio tone. Unfortunately, the SNR is very poor and it's very hard to listen to, I guess owing to the fact that I'm also modulating all the noise in the incoming signal.
> > I just thought of a slicker way. Discard one of I or Q, > and use the other's presence or absence to turn an > oscillator on and off. Filter the gated output to remove > clicks on transitions. >
This was my first idea. It has the attractive feature that what the operator hears is decoupled from the received signal, so no chirp from a poorly regulated transmitter, audio level and frequency are constant, attack and decay controlled at the receiving end, no impulse noise to blow out the operators' eardrums, etc. After looking at the noise in a typical signal, I decided that I couldn't reliably detect the presence or absence of keying.
John E. Hadstate wrote:
> "Jerry Avins" <jya@ieee.org> wrote in message > news:SeSdnaXPwKPe7ZvZRVn-iA@rcn.net... > > John E. Hadstate wrote: > >> What's the slickest way of turning an I/Q data stream, > >> tuned to baseband, into audible Morse Code with > >> user-selectable pitch using strictly digital signal > >> processing? > > > > Shift it up or down by the selected pitch. That requires a > > tunable quadrature audio oscillator, two multiplications, > > and an addition if the picture in my head is correct. > > That's what I thought. Basically, my oscillator generates > I/Q components at the desired audio frequency (amplitude 0.5 > units). I add a bias of 0.5 to each component and multiply > the result by the pre-detected incoming signal, effectively > 100% amplitude modulating the keyed carrier. After running > it through the AM detector, I thought I should have a usable > keyed audio tone. > > Unfortunately, the SNR is very poor and it's very hard to > listen to, I guess owing to the fact that I'm also > modulating all the noise in the incoming signal. > > > > > I just thought of a slicker way. Discard one of I or Q, > > and use the other's presence or absence to turn an > > oscillator on and off. Filter the gated output to remove > > clicks on transitions. > > > > This was my first idea. It has the attractive feature that > what the operator hears is decoupled from the received > signal, so no chirp from a poorly regulated transmitter, > audio level and frequency are constant, attack and decay > controlled at the receiving end, no impulse noise to blow > out the operators' eardrums, etc. After looking at the > noise in a typical signal, I decided that I couldn't > reliably detect the presence or absence of keying.
How about looking for the presence or absense of, not just keying, but actual dits and dahs with a minimum of one dit times spacing at an approximately known WPM? Correlate the IQ energy against two rectangles of 3X different lengths, look for a triangle shaped peak (maybe via a second correlation), then key an artificially synthesized dit or dah. Maintain some running statistics on the detected length of the actual dit/dah evelopes to update your WPM estimate, and perhaps even characterize the keyers "fist" depending on the character sent and previous text in the buffer. In high noise situations, perhaps modulate the volume of the synthetic dit or dah by the statistical likelyhood of its presense in the IQ signal (degree of fit and spacing in time from previous characters). One problem with this is that there will be some processing lag, which will interfere with break-in type interactive responses. There's also the issue of picking an initial seed WPM. An fft of the amplitude history might give some clues. IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
"John E. Hadstate" <jh113355@hotmail.com> wrote in message 
news:gEANf.10500$eQ3.6327@bignews4.bellsouth.net...
> > "Jerry Avins" <jya@ieee.org> wrote in message > news:SeSdnaXPwKPe7ZvZRVn-iA@rcn.net... >> John E. Hadstate wrote: >>> What's the slickest way of turning an I/Q data stream, >>> tuned to baseband, into audible Morse Code with >>> user-selectable pitch using strictly digital signal >>> processing? >> >> Shift it up or down by the selected pitch. That requires >> a tunable quadrature audio oscillator, two >> multiplications, and an addition if the picture in my >> head is correct. > > That's what I thought. Basically, my oscillator generates > I/Q components at the desired audio frequency (amplitude > 0.5 units). I add a bias of 0.5 to each component and > multiply the result by the pre-detected incoming signal, > effectively 100% amplitude modulating the keyed carrier. > After running it through the AM detector, I thought I > should have a usable keyed audio tone. >
Note: If you generate one sine (scalar) sine wave and multiplex it into a complex stream (with both real and imaginary components being the original scalar sine wave), it seems to produce a detected signal that is much more "listenable." It also produces a pre-detected spectrum that looks a lot more like AM.
In article <wmtNf.13936$Pv1.12979@bignews6.bellsouth.net>, "John E. Hadstate" <jh113355@hotmail.com> wrote:
>What's the slickest way of turning an I/Q data stream, tuned >to baseband, into audible Morse Code with user-selectable >pitch using strictly digital signal processing? > > >
John, The CW pitch-shifting feature is in the Timewave DSP-599zx audio processor. You can chose the input frequency and the output frequency independently from 200 Hz to 1975 Hz. In the same unit we have a feature called the RTTY remodulator that processes an incoming noisy FSK signal and keys an FSK oscillator to produce a clean replica of the FSK signal. The clean signal can be easily detected by any less robust analog or digital FSK demodulator. Unfortunately, we never implemented the remodulation feature for CW nor the pitch shift feature for FSK. About 10 years ago, Al Clark (now of Danville Signal Processing) designed the DSP code for these features after I told him what we needed. Al is not a ham and I am so we had to put our heads together to figure out what to do. Of course we are not going to reveal how we do it because the unit is still in our product line, but at least you can see that it is possible and there is room for improvement by combining the two features. For a little more information (and a testament to Al's DSP coding prowess), you can download the DSP-599zx manual from http://www.timewave.com/Acrobat/599zxom.pdf Is this the slickest way? I don't know, but it works! Randy Gawtry, K0CBH Timewave
"Randall Gawtry" <rgawtry@timewave.com> wrote in message 
news:120idnk9chio3b@corp.supernews.com...
> In article <wmtNf.13936$Pv1.12979@bignews6.bellsouth.net>, > "John E. Hadstate" <jh113355@hotmail.com> wrote: >>What's the slickest way of turning an I/Q data stream, >>tuned >>to baseband, into audible Morse Code with user-selectable >>pitch using strictly digital signal processing? >> >> >> > > John, > > The CW pitch-shifting feature is in the Timewave DSP-599zx > audio processor.
Thanks, but I don't have one of those, and I'm not likely to get one of those. ******************************************** ** ** ** > Of course we are not going to reveal ** ** > how we do it because the unit is ** ** > still in our product line... ** ** ** ******************************************** In other words, you don't have any information to contribute to the thread but you couldn't resist the opportunity to flog your product. I'm sure our friends around the world appreciate the high value that you place on your trade secrets. On behalf of every scumbag in the world whose communications will go undetected as a result of your diligence, and on behalf of every American killed because we missed something to protect your profits, I thank you for the obvious effort you've made to get your priorities straight. I hope you and your shareholders sleep well tonight. Tomorrow might be a very long day.
> > Randy Gawtry, K0CBH > Timewave