CW Mode for the NUE-PSK Digital Modem

Download Report

Transcript CW Mode for the NUE-PSK Digital Modem

Using DSP filtering techniques to isolate and process
Morse code for both receive and transmit in the
Amateur Radio bands … without a PC!
by Dave Collins, AD7JT
and
George Heron, N2APB
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
1
Agenda
• Session I
– Introduction
– Transmit Channel
– Q&A
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash
Drive
• Session II
– Receive Channel
– Results/Conclusions
– Q&A
Audio from
Transceiver
AGC
Goertzel Tweaking
Tune
Bandpass
Level
PGA and
ADC
Goertzel
Filter
Morse to
ASCII
LCD Graphic
Display
USB Option
Card
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
Fence Tweaking
Character
Word
Mark
Grouping
Flash
Drive
2
WHY?
• NUE-PSK Modem = Standalone digital mode operation
… no PC required!
• Introduced ~ 4 years ago … PSK31, then other modes
• Users clamored for CW support, but …
• Classic performance problems with “CW Readers”
• NUE-PSK Modem has a “leg up”:
– DSP processing
– Nice spectral Display
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
3
System Configuration
SSB
XCVR
Audio Out
NUE-PSK DIGITAL MODEM
dsPIC33FJ128MC706
PGA
ADC
Goertzel
Filter
OOK
to
ASCII
128 x 64
GRAPHIC
DISPLAY
PTT
Audio In
DAC
CWID
Encode
ASCII
to
OOK
PS/2 KEYBOARD
• Modem interfaces to
transceiver with modulated,
base-band audio signals.
• CW is transmitted and received
as SSB signals.
• Transceiver operates in SSB or
Digital mode, NOT CW MODE.
16-SEP-2011
• Modulation is done with onoff delivery of an audio tone.
• Received audio is digitized at
8,000 samples per second
• A Goertzel filter reconstructs
the On-Off Keying signal.
• Characters are translated to
ASCII and displayed
2011 TAPR-ARRL Digital Communications Conference
4
• Keyboard-to-Morse conversion
– Simple speed (wpm) control
– “Perfect” DIT-DAH and SPACE
timing
• Tone generation with existing
PSK modulator
SSB
XCVR
Audio Out
NUE-PSK DIGITAL MODEM
dsPIC33FJ128MC706
PGA
ADC
OOK
to
ASCII
Goertzel
Filter
128 x 64
GRAPHIC
DISPLAY
PTT
Audio In
• Goertzel filter to detect the tone
• Morse-to-ASCII conversion
DAC
ASCII
to
OOK
CWID
Encode
PS/2 KEYBOARD
– Automatic speed detection & tracking
– Automatic DIT-DAH weighting adjustments
– Manual tweaking to accommodate imperfect “fists”
• Tuning algorithm and indication
– Tune with AFC (simplifies tuning and tracks drifters)
– Bandwidth control
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
5
C
INTER-ELEMENT SPACES
INTER-CHARACTER
SPACE
MARK -------SPACE ---Length --------
DASH
DOT
DASH
DOT
----3---- -1- -1- -1- ----3---- -1- -1- ----3---Tcw Tcw Tcw
Tcw
Tcw
Tcw Tcw
Tcw
• MARK = Key down, SPACE = Key up
• Tcw is the basic unit of timing for CW
• Inter-word SPACE = 7 x Tcw (minimum)
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
6
• Words Per Minute (wpm) calculations
– Standard word = “PARIS ”
– Contains exactly 50 Tcw including the ending Inter-word
SPACE
– Therefore, wpm = 1200 / Tcw where Tcw is expressed in
milliseconds
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
7
Transmit Channel
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash Drive
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
8
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash
Drive
•
•
•
•
•
Standard PS/2 keyboard interface
Forced Caps Lock mode
Upper-case letters for normal text
Lower-case letters for prosigns
Hot-keys for entering
<My Call> and <Their Call>
• Support for Serial Numbers
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
9
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash
Drive
• Seven, separate CW macros
• Up to 255 Characters each
• Tags for <TXON>, <MYCALL>, <THEIRCALL>, <TXOFF>, and
<SERIALNO>
• Flexible save, restore, and edit functions
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
10
•
•
•
•
•
16-SEP-2011
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash
Drive
Four lines of text are displayed with line-scrolling.
Operator controls wpm (Tune) and side tone (Ctrl-Tune).
Displayed characters are over lined until transmitted.
Text is transmitted only as full words.
Prosigns are displayed as lower-case letters.
2011 TAPR-ARRL Digital Communications Conference
11
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
0x43: 10 01 10 01 11 00 00 00
USB Option
Card
Flash
Drive
C
D
A
S
H
•
•
•
•
D
O
T
D
A
S
H
D
O
T
2
T
C
W
E
N
D
ASCII to Morse Look Up Table
Each element followed by 1 Tcw SPACE
Uses PSK CWID feature
8,000 output samples per second
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
12
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash Drive
Questions?
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
13
Session II
• Receive Channel
• Results/Conclusions
• Q&A
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
15
Receive Channel
AGC
Audio from
Transceiver
Goertzel Tweaking Fence Tweaking
Level Tune Bandpass Character Word
PGA and
ADC
Goertzel
Filter
Morse to
ASCII
LCD Graphic
Display
USB Option
Card
16-SEP-2011
Mark
Grouping
Flash Drive
2011 TAPR-ARRL Digital Communications Conference
16
Goertzel Tweaking
AGC
Audio from
Transceiver
Level Tune Bandpass Character
PGA and
ADC
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
g_coef = 2 * cos(2 * PI * center_frequency / 8000)
g_sample
. . . . . . . . . . . . . . . . . .
q0
q1
g_coeff
q2
-1
g_sample = (((double) f_samp)/32768.0);
q0 = g_coef*q1 - q2 + g_sample;
q2 = q1;
q1 = q0;
if(++g_sample_count >= cw_n){
g_sample_count = 0;
cw_n = cw_bwa[cw_bwa_index];
g_current = q1*q1 + q2*q2 - q1*q2*g_coef;
q2 = 0;
q1 = 0;
. . . . . . . . . . . . . . . . . .
•
•
•
•
Specialized DFT algorithm
Used for DTMF decoding
Very simple to implement
Very fast to execute
16-SEP-2011
• f_sample is the raw, digitized input signal
• g_coef determines the pass band center
frequency
• The band pass is the sampling frequency (8000)
divided by the block length (cw_n)
• g_current is the filter output
2011 TAPR-ARRL Digital Communications Conference
17
AGC
Audio from
Transceiver
•
•
•
PGA and
ADC
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
Level (Threshold)
Bandwidth
Threshold defines MARK/SPACE “fence”
Normally calculated as average
between recognized MARKs and SPACEs
Operator can override the calculations
• Operator can select between 100
Hz and 1000 Hz in eight steps
• Narrower the pass band, the longer
the Goertzel calculation takes
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
18
AGC
Audio from
Transceiver
PGA and
ADC
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
Block Length
(cw_n)
Bandwidth
(Hz)
Time/Block
(ms)
8
1000
1.00
10
800
1.25
16
500
2.00
20
400
2.50
32
250
4.00
40
200
5.00
50
160
1.25
64
125
8.00
80
100
10.00
16-SEP-2011
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
• Block length (cw_n) must be an
integral factor of the sampling rate
• The modem’s bandwidth is bound
by the transceiver’s bandwidth
• Tcw should be at least 4 times the
Time per Block
• Therefore:
Maximum wpm = 1200 / ( 4 x
Time/Block) [ 300 – 30 wpm ]
2011 TAPR-ARRL Digital Communications Conference
19
AGC
Audio from
Transceiver
PGA and
ADC
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
Acquire
(End)
g_coef =
1.600102
g_coef =
1.614280
g_coef = 2 * cos(2 * PI * center_frequency / 8000)
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
20
AGC
Audio from
Transceiver
PGA and
ADC
•
•
•
•
16-SEP-2011
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
CW modulates time – not waveforms
MARK and SPACE lengths are averaged
Fences are calculated
MARKs are grouped
2011 TAPR-ARRL Digital Communications Conference
21
AGC
PGA and
ADC
Audio from
Transceiver
•
•
•
•
16-SEP-2011
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
MARKs only come in two flavors
Tcw = (MARK average) / 2
Duplicate MARK lengths are limited
The DIT-DAH fence is the average MARK length
plus the average mean deviation
2011 TAPR-ARRL Digital Communications Conference
22
AGC
Audio from
Transceiver
PGA and
ADC
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
• SPACEs come in three flavors
• Any SPACE ends a MARK
• When a SPACE length exceeds the character fence,
the MARK group is processed
• When a SPACE duration exceeds the word fence, a
space code is inserted in the text.
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
23
AGC
PGA and
ADC
Audio from
Transceiver
•
•
•
•
16-SEP-2011
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
The MARK Tcw is the basis for SPACE fences
Character SPACE lengths are averaged
Character fence = 2 x inter- element average
Word fence = 2.5 x character fence
2011 TAPR-ARRL Digital Communications Conference
24
AGC
PGA and
ADC
Audio from
Transceiver
•
•
•
•
16-SEP-2011
Goertzel Tweaking
Level Tune Bandpass Character
Goertzel
Filter
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse to
ASCII
Flash
Drive
LCD Graphic
Display
Operator can override SPACE fence calculations
Can vary Tcw multipliers by tenths
Will lock until Enter is pressed
Receive continues during tweaking
2011 TAPR-ARRL Digital Communications Conference
25
Goertzel Tweaking
AGC
Audio from
Transceiver
Level Tune Bandpass Character
PGA and
ADC
Goertzel
Filter
Index
Factor
‘C’
Value
0
1
1
1
1
2
2
4
2
4
1
4
3
8
2
16
4
16
0
0
5
32
0
0
6
64
0
0
7
128
0
0
16-SEP-2011
USB Option
Card
Fence Tweaking
Word
Mark
Grouping
Morse
to ASCII
Flash
Drive
LCD Graphic
Display
0000000000111111111122222222223
0123456789012345678901234567890
*ETIANMSURWDKGOHVF*L*PJBXCYZQ**
• Sum of products for ‘C’ = 25
• This works for 1, 2, 3, and 4 Morse elements
• Mark groups with 5, 6, 7, and 8 Morse
elements are translated with brute-force
• Prosigns are translated to two, lower-case
letters
• Group overflow generates a ‘#’
2011 TAPR-ARRL Digital Communications Conference
26
AGC
Audio from
Transceiver
Goertzel Tweaking
Fence Tweaking
Level Tune Bandpass Character Word
PGA and
ADC
Goertzel
Filter
Morse to
ASCII
LCD Graphic
Display
USB Option
Card
Mark
Grouping
Flash Drive
Questions?
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
27
Conclusions
•
•
•
•
•
•
16-SEP-2011
Goertzel filter outperforms expectations
Tuning at the modem is a must
Word SPACE multiple most useful tweak
Zkew least useful tweak
A good aid for CW contesting
Using it to check your “fist” can be humbling
2011 TAPR-ARRL Digital Communications Conference
28
Future Project Candidates
• Keyboard-less configuration
… Paddle input to built-in keyer:
• ORed with keyboard and macro input
• ORed with Goertzel filter output
•
•
•
•
16-SEP-2011
The ultimate
“Portable Digital
Station”
(The original
“Portable PSK”
vision from 2001)
Display-less configuration (Morse audio)
Logging to flash drive in a standard format
Incorporate modem functions in SDR Cube … in progress!
More?
2011 TAPR-ARRL Digital Communications Conference
29
Summary
Receive
Transmit
AGC
Keyboard
Scan Code
Processing
ASCII to
Morse
Phase
Modulator
EEPROM
Macro
Playback
LCD Graphic
Display
Audio to
Transceiver
USB Option
Card
Flash
Drive
Audio from
Transceiver
Goertzel Tweaking
Fence Tweaking
Level Tune Bandpass Character Word
PGA and
ADC
Goertzel
Filter
Morse
to ASCII
LCD Graphic
Display
USB Option
Card
16-SEP-2011
2011 TAPR-ARRL Digital Communications Conference
Mark
Grouping
Flash
Drive
30
Thank you!
Dave Collins, AD7JT
22111 N San Ramon Drive
Sun City West, AZ 85375
[email protected]
16-SEP-2011
George Heron, N2APB
2419 Feather Mae Ct
Forest Hill, MD 21050
[email protected]
2011 TAPR-ARRL Digital Communications Conference
31