![]() At every received element (dot or dash) halve the initial dash jump and then increase by 1 the index inside the lookup string if a dot was received and by dash jump size if a dash was received. Have an index inside the lookup string inizialied to zero. The algorithm can be decribed as follows. The pre calculated string has been prepared by running through the algorithm the morse code of each letter and seeing where it caused it to land in the string. The alghorithm performs fundamentally a binary search inside a precalculated string taking either one of two branches according to the current symbol being a dot or a dash. ![]() Morse to ASCIIįor the conversion from morse (sequences of dots and dashes) to ASCII I make use of an alghotithm that I have not seen published anywhere so far. We can see that with a captured RMS level below 5 there is no response, above that the response settles around 700 regardless of input signal amplitude, which is the desired response. This was taken at a constant frequency of 700Hz: The following graph shows the action of the AGC and the squelch and represents the variation in amplitude of the Goertzel output as a fuction of the captured sigal amplitude. We can see anyhow that at a 15Hz deviation the respose is already more than 7dB down. The first thing we notice is that the peak of the respose is actually around 695, this is probably due to slight innacuracy in the sampling frequency, though I have no exact measure of the accuracy of the geerator (an HTML5 script). The graph below shows the frequency respose: I have produced tones of varying frequency, in few Hz steps, around 700Hz. The first is the frequency response of the Goertzel. I have run some tests, by adding serial prints of values at various stages. The alghorithm employed to translate the sequence of dots and dashes to ASCII is decribed in the next section. Depending on the level being above or below a preset threshold the application estimates dots, dashes, inter-element, inter-letter and inter-word stages of the signal and proceeds to decode those to ASCII chars. Once the presence of the signal is determined a simple state machine is employed to keep track of the current status at each iteration. This is much more efficient than an FFT and, hence, allows to get estimates faster, so more often. This prevents noise from triggering the decoder.įinally we use Goetzel to detect the presence of the 700Hz component of the captured audio. Additionally at this stage we apply a squelch, which is responsbile to mute completely the sampled signal if its level is below a certain threshold. This is desirable as we aim only at detecting the presence of the tone. Note that this signal has double frequency of the original and, will have also some extra harmonic content due to the discontinuity around zero, so this signal is suitable only to evaluate average power, for later processing the original signal minus the DC will be used.Īfter that we apply an AGC (Automatic Gain Conttrol), this doesn't enhance the SNR, since it's done after the D/A, anyhow it allows to keep the signal level constat, so that the output of the following stages is independent of the captured signal level. The signal after rectification looks like this, and the red line represents the average: If we didn't rectify it the average would be zero. After removing the DC we are left with the signal centered aroud zero:Īt this point we rectify it and calculate an average level. This is good as the ADC can sample only levels above zero but we need to get rid of the DC to be able to evaluate the amplitude of the signal. You can see a video of the device in action at: Signal detectionĪfter sampling the first thing we do is to remove the DC component, it should be remembered that the pramplifier is a class A amplifier and is DC coupled with the A/D, so the signal swings around VCC/2, the input signal looks like in the plot below: ![]() The current code expects audio at 700Hz and a morse speed around 13 WPM. The hardware is a very simple board I used in many other my DSP projects, just an Arduino Nano with a microphone and a pre-amp. The goal of this project is to develop a device able to listen for audio containing morse code and decode its text to serial port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |