CW Mode for the NUE-PSK Digital Modem

Document Sample
CW Mode for the NUE-PSK Digital Modem Powered By Docstoc
					   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
                                                                Scan Code                      ASCII to             Phase
      – Introduction                             Keyboard
                                                                Processing                     Morse               Modulator


      – Transmit Channel                         EEPROM          Macro
                                                                Playback
                                                                                            LCD Graphic
                                                                                              Display
                                                                                                                    Audio to
                                                                                                                   Transceiver

      – Q&A
                                                                                            USB Option                 Flash
                                                                                               Card                    Drive



• Session II                                                    AGC          Level
                                                                                     Goertzel Tweaking
                                                                                        Tune     Bandpass
                                                                                                             Fence Tweaking
                                                                                                            Character   Word



      – Receive Channel                         Audio from
                                                Transceiver
                                                              PGA and
                                                                ADC
                                                                                      Goertzel
                                                                                       Filter
                                                                                                                 Mark
                                                                                                               Grouping

      – Results/Conclusions
      – Q&A                                                   Morse to
                                                               ASCII
                                                                                 LCD Graphic
                                                                                   Display


                                                                                 USB Option                    Flash
                                                                                    Card                       Drive



16-SEP-2011           2011 TAPR-ARRL Digital Communications Conference                                                           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              NUE-PSK DIGITAL MODEM
                                               XCVR                      dsPIC33FJ128MC706
                                                                                           OOK         128 x 64
                                                           PGA     ADC      Goertzel        to         GRAPHIC
                                               Audio Out                     Filter        ASCII       DISPLAY
                                                    PTT
                                                                              CWID         ASCII
                                                Audio In           DAC                      to
                                                                             Encode        OOK


                                                                                       PS/2 KEYBOARD



• Modem interfaces to                         • Modulation is done with on-
  transceiver with modulated,                   off delivery of an audio tone.
  base-band audio signals.                    • Received audio is digitized at
• CW is transmitted and received                8,000 samples per second
  as SSB signals.                             • A Goertzel filter reconstructs
• Transceiver operates in SSB or                the On-Off Keying signal.
  Digital mode, NOT CW MODE.                  • Characters are translated to
                                                ASCII and displayed
16-SEP-2011        2011 TAPR-ARRL Digital Communications Conference                                               4
  • Keyboard-to-Morse conversion
        – Simple speed (wpm) control                      SSB              NUE-PSK DIGITAL MODEM
        – “Perfect” DIT-DAH and SPACE                    XCVR                      dsPIC33FJ128MC706
          timing                                         Audio Out   PGA     ADC      Goertzel
                                                                                                     OOK
                                                                                                      to
                                                                                                                 128 x 64
                                                                                                                 GRAPHIC
                                                                                       Filter        ASCII
  • Tone generation with existing
                                                                                                                 DISPLAY
                                                              PTT
                                                                                        CWID         ASCII
    PSK modulator                                         Audio In           DAC
                                                                                       Encode
                                                                                                      to
                                                                                                     OOK


                                                                                                 PS/2 KEYBOARD

  • Goertzel filter to detect the tone
  • Morse-to-ASCII conversion
        – 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
                                                                               INTER-CHARACTER
                    C                        INTER-ELEMENT SPACES                   SPACE

MARK --------
                        DASH           DOT                 DASH               DOT
SPACE ----
Length --------    ----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

                Scan Code                        ASCII to           Phase
     Keyboard
                Processing                       Morse             Modulator


                 Macro                        LCD Graphic           Audio to
     EEPROM                                     Display
                Playback                                           Transceiver


                                               USB Option
                                                                   Flash Drive
                                                  Card




16-SEP-2011     2011 TAPR-ARRL Digital Communications Conference                 8
              Keyboard        Scan Code          ASCII to       Phase
                              Processing         Morse         Modulator



              EEPROM           Macro            LCD Graphic     Audio to
                              Playback            Display      Transceiver



                                                USB Option       Flash
                                                   Card          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          ASCII to       Phase
                              Processing         Morse         Modulator



              EEPROM           Macro            LCD Graphic     Audio to
                              Playback            Display      Transceiver



                                                USB Option       Flash
                                                   Card          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
                    Keyboard        Scan Code          ASCII to       Phase
                                    Processing         Morse         Modulator



                    EEPROM           Macro            LCD Graphic     Audio to
                                    Playback            Display      Transceiver



                                                      USB Option       Flash
                                                         Card          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.
16-SEP-2011                  2011 TAPR-ARRL Digital Communications Conference      11
                      Keyboard            Scan Code          ASCII to       Phase
                                          Processing         Morse         Modulator



        C                 EEPROM           Macro
                                          Playback
                                                            LCD Graphic
                                                              Display
                                                                            Audio to
                                                                           Transceiver



                                                            USB Option       Flash
0x43: 10 01 10 01 11 00 00 00                                  Card          Drive
        D     D   D   D      2      E
        A     O   A   O      T      N
        S         S          C
        H     T   H   T             D
                             W




•   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
                    Scan Code                         ASCII to         Phase
        Keyboard
                    Processing                        Morse           Modulator


                      Macro                        LCD Graphic         Audio to
        EEPROM                                       Display          Transceiver
                     Playback


                                                   USB Option
                                                                      Flash Drive
                                                      Card



                           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
                                    Goertzel Tweaking Fence Tweaking
                  AGC             Level Tune Bandpass Character Word

  Audio from    PGA and                   Goertzel                       Mark
  Transceiver     ADC                      Filter                      Grouping




                Morse to               LCD Graphic
                 ASCII                   Display


                                        USB Option
                                                                  Flash Drive
                                           Card

16-SEP-2011         2011 TAPR-ARRL Digital Communications Conference              16
                                                                                            USB Option        Flash
                                Goertzel Tweaking   Fence Tweaking                             Card           Drive
                  AGC          Level Tune Bandpass Character   Word

  Audio from    PGA and             Goertzel             Mark              Morse to         LCD Graphic
  Transceiver     ADC                Filter            Grouping             ASCII             Display


                                                           g_coef = 2 * cos(2 * PI * center_frequency / 8000)
          g_sample                                                . . . . . . . . . . . . . . . . . .
                                      q0                   g_sample = (((double) f_samp)/32768.0);
                                                           q0 = g_coef*q1 - q2 + g_sample;
                                                           q2 = q1;
                               q1
                     g_coeff                               q1 = q0;

                                                           if(++g_sample_count >= cw_n){
                                                                g_sample_count = 0;
                               q2
                                                                cw_n = cw_bwa[cw_bwa_index];
                        -1
                                                                  g_current = q1*q1 + q2*q2 - q1*q2*g_coef;
                                                                  q2 = 0;
                                                                  q1 = 0;
                                                                  . . . . . . . . . . . . . . . . . .

     •   Specialized DFT algorithm                   • f_sample is the raw, digitized input signal
     •   Used for DTMF decoding                      • g_coef determines the pass band center
     •   Very simple to implement                      frequency
                                                     • The band pass is the sampling frequency (8000)
     •   Very fast to execute                          divided by the block length (cw_n)
                                                     • g_current is the filter output
16-SEP-2011                      2011 TAPR-ARRL Digital Communications Conference                                     17
                                                                                 USB Option    Flash
                            Goertzel Tweaking    Fence Tweaking                     Card       Drive
                    AGC     Level Tune Bandpass Character   Word

    Audio from    PGA and      Goertzel               Mark          Morse to     LCD Graphic
    Transceiver     ADC         Filter              Grouping         ASCII         Display




                  Level (Threshold)                                        Bandwidth
•    Threshold defines MARK/SPACE “fence”                      • Operator can select between 100
                                                                 Hz and 1000 Hz in eight steps
•    Normally calculated as average
                                                               • Narrower the pass band, the longer
     between recognized MARKs and SPACEs
                                                                 the Goertzel calculation takes
•    Operator can override the calculations


16-SEP-2011                   2011 TAPR-ARRL Digital Communications Conference                         18
                                                                                 USB Option    Flash
                            Goertzel Tweaking    Fence Tweaking                     Card       Drive
                  AGC       Level Tune Bandpass Character   Word

  Audio from    PGA and        Goertzel               Mark         Morse to      LCD Graphic
  Transceiver     ADC           Filter              Grouping        ASCII          Display




Block Length
   (cw_n)
                Bandwidth
                   (Hz)
                             Time/Block
                                (ms)            • Block length (cw_n) must be an
                                                  integral factor of the sampling rate
      8           1000           1.00
                                                • The modem’s bandwidth is bound
     10            800           1.25
     16            500           2.00
                                                  by the transceiver’s bandwidth
     20            400           2.50
                                                • Tcw should be at least 4 times the
     32            250           4.00             Time per Block
     40            200           5.00           • Therefore:
     50            160           1.25             Maximum wpm = 1200 / ( 4 x
     64            125           8.00             Time/Block) [ 300 – 30 wpm ]
     80            100          10.00
16-SEP-2011                   2011 TAPR-ARRL Digital Communications Conference                         19
                                                                                  USB Option    Flash
                          Goertzel Tweaking    Fence Tweaking                        Card       Drive
                  AGC     Level Tune Bandpass Character   Word

  Audio from    PGA and      Goertzel               Mark             Morse to     LCD Graphic
  Transceiver     ADC         Filter              Grouping            ASCII         Display




                                                                 Acquire
                                                                  (End)


                                         g_coef =                               g_coef =
                                         1.600102                               1.614280

  g_coef = 2 * cos(2 * PI * center_frequency / 8000)

16-SEP-2011                 2011 TAPR-ARRL Digital Communications Conference                            20
                                                                               USB Option    Flash
                          Goertzel Tweaking    Fence Tweaking                     Card       Drive
                    AGC   Level Tune Bandpass Character   Word

  Audio from    PGA and      Goertzel              Mark          Morse to      LCD Graphic
  Transceiver     ADC         Filter             Grouping         ASCII          Display




                •     CW modulates time – not waveforms
                •     MARK and SPACE lengths are averaged
                •     Fences are calculated
                •     MARKs are grouped




16-SEP-2011                 2011 TAPR-ARRL Digital Communications Conference                         21
                                                                                   USB Option    Flash
                              Goertzel Tweaking    Fence Tweaking                     Card       Drive
                      AGC     Level Tune Bandpass Character   Word

  Audio from        PGA and      Goertzel              Mark          Morse to      LCD Graphic
  Transceiver         ADC         Filter             Grouping         ASCII          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




16-SEP-2011                     2011 TAPR-ARRL Digital Communications Conference                         22
                                                                                 USB Option    Flash
                            Goertzel Tweaking    Fence Tweaking                     Card       Drive
                    AGC     Level Tune Bandpass Character   Word

  Audio from      PGA and      Goertzel              Mark          Morse to      LCD Graphic
  Transceiver       ADC         Filter             Grouping         ASCII          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
                                                                                   USB Option    Flash
                              Goertzel Tweaking    Fence Tweaking                     Card       Drive
                      AGC     Level Tune Bandpass Character   Word

  Audio from        PGA and      Goertzel              Mark          Morse to      LCD Graphic
  Transceiver         ADC         Filter             Grouping         ASCII          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




16-SEP-2011                     2011 TAPR-ARRL Digital Communications Conference                         24
                                                                                   USB Option    Flash
                               Goertzel Tweaking   Fence Tweaking                     Card       Drive
                      AGC     Level Tune Bandpass Character   Word

  Audio from        PGA and      Goertzel              Mark          Morse to      LCD Graphic
  Transceiver         ADC         Filter             Grouping         ASCII          Display




                •     Operator can override SPACE fence calculations
                •     Can vary Tcw multipliers by tenths
                •     Will lock until Enter is pressed
                •     Receive continues during tweaking
16-SEP-2011                     2011 TAPR-ARRL Digital Communications Conference                         25
                                                                                       USB Option    Flash
                                   Goertzel Tweaking   Fence Tweaking                     Card       Drive
                      AGC         Level Tune Bandpass Character   Word

  Audio from      PGA and            Goertzel               Mark           Morse       LCD Graphic
  Transceiver       ADC               Filter              Grouping        to ASCII       Display




  Index         Factor      ‘C’         Value
                                                         0000000000111111111122222222223
     0            1         1              1
                                                         0123456789012345678901234567890
     1            2         2              4             *ETIANMSURWDKGOHVF*L*PJBXCYZQ**
     2            4         1              4
                                                         • Sum of products for ‘C’ = 25
     3            8         2             16
                                                         • This works for 1, 2, 3, and 4 Morse elements
     4           16         0              0             • Mark groups with 5, 6, 7, and 8 Morse
     5           32         0              0               elements are translated with brute-force
                                                         • Prosigns are translated to two, lower-case
     6           64         0              0
                                                           letters
     7           128        0              0             • Group overflow generates a ‘#’
16-SEP-2011                         2011 TAPR-ARRL Digital Communications Conference                         26
                                                 Goertzel Tweaking Fence Tweaking
                               AGC            Level Tune Bandpass Character Word

              Audio from    PGA and                  Goertzel                    Mark
              Transceiver     ADC                     Filter                   Grouping



                            Morse to               LCD Graphic
                             ASCII                   Display


                                                    USB Option
                                                       Card               Flash Drive




                                           Questions?
16-SEP-2011                 2011 TAPR-ARRL Digital Communications Conference              27
                                  Conclusions

              •   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




16-SEP-2011               2011 TAPR-ARRL Digital Communications Conference   28
                    Future Project Candidates
      • Keyboard-less configuration
                                                                               The ultimate
         … Paddle input to built-in keyer:
                                                                             “Portable Digital
                  • ORed with keyboard and macro input
                                                                                 Station”
                  • ORed with Goertzel filter output
                                                                                 (The original
      •       Display-less configuration (Morse audio)                         “Portable PSK”
      •       Logging to flash drive in a standard format                     vision from 2001)

      •       Incorporate modem functions in SDR Cube … in progress!
      •       More?


16-SEP-2011               2011 TAPR-ARRL Digital Communications Conference                   29
                                            Summary

                     Transmit                                                       Receive
                                                                                       Goertzel Tweaking Fence Tweaking
                                                                            AGC      Level Tune Bandpass Character Word
                Scan Code     ASCII to       Phase
Keyboard                      Morse         Modulator
                Processing                                Audio from     PGA and         Goertzel             Mark
                                                          Transceiver      ADC            Filter            Grouping
                 Macro       LCD Graphic     Audio to
EEPROM          Playback       Display      Transceiver


                                                                          Morse        LCD Graphic
                             USB Option       Flash
                                Card          Drive                      to ASCII        Display


                                                                                       USB Option           Flash
                                                                                          Card              Drive




  16-SEP-2011                    2011 TAPR-ARRL Digital Communications Conference                                30
                                  Thank you!




          Dave Collins, AD7JT                               George Heron, N2APB
       22111 N San Ramon Drive                              2419 Feather Mae Ct
        Sun City West, AZ 85375                             Forest Hill, MD 21050
         dmc@dnbrealty.com                            n2apb@MidnightDesignSolutions.com



16-SEP-2011             2011 TAPR-ARRL Digital Communications Conference              31

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:39
posted:6/23/2012
language:English
pages:31