Cov txheej txheem:

Binary Tree Morse Decoder: 7 Kauj Ruam (nrog Duab)
Binary Tree Morse Decoder: 7 Kauj Ruam (nrog Duab)

Video: Binary Tree Morse Decoder: 7 Kauj Ruam (nrog Duab)

Video: Binary Tree Morse Decoder: 7 Kauj Ruam (nrog Duab)
Video: Binary Tree Morse Decoder 2024, Hlis ntuj nqeg
Anonim
Image
Image
Daim duab Circuit Court
Daim duab Circuit Court

Cov lus qhia no piav qhia yuav txiav txim siab li cas Morse Code siv Arduino Uno R3.

Tus txiav txim siab, uas tau hloov kho kom nrawm, muaj peev xwm txiav txim siab morse txog li 80 lo lus ib feeb twg.

Cov cai nkag los tau nthuav tawm raws li cov ntawv ntawm koj Arduino Serial Monitor (lossis TFT screen yog haum)

Lub suab oscillator tau suav nrog yog tias koj xav xyaum xyaum morse.

Lub decoder nta:

  • 320 x 240 TFT zaub module [1]
  • Goertzel digital bandpass lim rau cais cov teeb meem tsis xav tau.
  • a "Binary Morse Tree" rau kev txiav txim siab lub teeb liab
  • pib-ceev mus txog qhovtwg
  • lub suab tso tawm thaum xyaum morse
  • cov ntawv nkag thiab tawm tau tshwm.

Cov cim thiab cov cim hauv qab no tau lees paub:

  • [UA.. Z]
  • [0..9]
  • [., ? ' ! / () &:; = + - _ " @]

Kwv yees kwv yees tus nqi ntawm morse daim iav thaiv kab mob, tsawg dua TFT zaub, yog $ 25. [1]

Duab

  • Daim duab npog qhia txog chav sib dhos ua ke
  • Cov vis dis aus qhia tus decoder ua haujlwm

Sau ntawv

[1]

  • TFT zaub module yog xaiv tau raws li txhua cov ntawv xa mus rau koj Arduino "Serial Monitor".
  • TFT module tau piav qhia hauv kuv cov lus qhia

Kauj Ruam 1: Daim Ntawv Teev Npe

Cov hauv qab no tau txais los ntawm

1 tsuas yog tsab ntawv tiv thaiv rau Arduino UNO R3, 2.54mm Suab

Cov hauv qab no tau txais hauv zos:

  • 1 tsuas yog LM358 dual opamp
  • 1 tsuas yog LED ntsuab
  • 1 tsuas yog LED clip
  • 1 tsuas yog electret microphone capsule
  • 1 tsuas yog ib txwm qhib-khawm-khawm
  • 1 tsuas yog 8-pin DIP qhov (socket)
  • 2 tsuas yog 330 ohm resistors
  • 2 tsuas yog 2K2 resistors
  • 5 tsuas yog 10K ohm resistors
  • 2 tsuas yog 56K ohm resistors
  • 2 tsuas yog 1uF capacitor
  • 1 tsuas yog 10uF capacitor

Cov hauv qab no yog nyob ntawm yeem:

  • 1 tsuas yog 2.2 Ntiag TFT SPI LCD Zaub Module 240*320 ILI9341 nrog SD Card Qhov rau Arduino Raspberry Pi 51/AVR/STM32/ARM/PIC [1]
  • Morse qhov tseem ceeb / laub-khawm
  • 1 tsuas yog BC548 NPN transistor
  • 1 tsuas yog 1 nti hais lus
  • 1 tsuas yog 33K ohm resistor
  • 1 tsuas yog 3.5mm mono plug (rau qhov tseem ceeb morse)
  • 1 tsuas yog 3.5mm mono socket (rau qhov tseem ceeb morse)
  • 3 tsuas yog 9mm M3 tapped nylon spacers
  • 1 tsuas yog 130 x 68 x 44mm ABS lub thawv yas
  • 5 tsuas yog 2-pin txoj cai-kaum txuas

Tus nqi kwv yees ntawm morse tus lej txiav txim, tsawg dua qhov xaiv TFT zaub, yog $ 25. [1]

Sau ntawv

[1]

Cov npe teev rau qhov xaiv tau 320 x 240 TFT zaub module tau teev tseg hauv kuv cov lus qhia

[2]

Tus yuam sij morse lossis lub laub khawm khov kho yuav tsum tau yog tias koj xav siv tus xa khoom.

Kauj Ruam 2: Daim duab Circuit Court

Daim duab Circuit Court
Daim duab Circuit Court
Daim duab Circuit Court
Daim duab Circuit Court
Daim duab Circuit Court
Daim duab Circuit Court

Duab

Daim duab 1 qhia txog daim duab qhia chaw rau lub tshuab txiav morse. 330 ohm resistor hauv kab nrog qhov yuam sij morse txwv D4 tso tawm tam sim no thaum muaj xwm txheej luv rau hauv av … nce nws tus nqi txo qis cov suab tso tawm los ntawm tus hais lus. Vim li no kuv tsis tau ntxiv nws rau daim ntaub thaiv tab sis txuas nws ncaj qha mus rau lub morse-key jack kom yooj yim ntawm kev hloov kho

Daim duab 2 qhia txog daim thaiv thaiv. Cov ntaub thaiv npog yog los ntawm kuv cov ntaub ntawv qhia https://www.instructables.com/id/Arduino-TFT-Grap… uas kuv tau ntxiv lub microphone amplifier thiab suab oscillator. [1]

Daim duab 3 qhia txog daim thaiv npog ua tiav nrog Arduino. Tsis muaj lwm yam khoom siv xav tau yog tias cov ntawv yuav tsum tau saib ntawm koj Arduino "Serial Monitor"

Daim duab 4 qhia txog tus lej txiav txim ib nrab lub thawv. Lub qhov tau raug txiav hauv lub hau rau saib cov zaub. Tus hais lus thiab lub microphone tau kub-lo rau rooj plaub. Laum qee tus neeg hais lus-lub qhov hauv lub hau ua ntej teeb tus hais lus. Lub qhov (socket) nruab nrab ntawm lub hau yog rau lub microphone txuas ntxiv… yam tsis muaj lub decoder no yuav tsum tau muab tso ze rau tus hais lus uas ib txwm ua tsis tau

Daim duab 5 qhia txog lub vijtsam TFT. Cov kab xev hluav taws xob dub tau txuas rau ntawm cov npoo pom … daim kab xev no tiv thaiv lub teeb tawm thiab npog qhov tsis raug ntawm qhov tso saib thiab qhib hauv lub hau

Tseem ceeb

[1]

Arduinos nrog USB txuas loj xav tau txheej txheej kab xev hluav taws xob nruab nrab ntawm USB txuas thiab Arduino ntaub thaiv npog. Kev hnav khaub ncaws luv yog ua tau yam tsis muaj daim kab xev raws li kev tshem tawm me me. Daim kab xev tsis xav tau rau Arduinos uas muaj cov txuas me me

Kauj ruam 3: Txoj kev xav

Txoj kev xav
Txoj kev xav
Txoj kev xav
Txoj kev xav
Txoj kev xav
Txoj kev xav

Txhua daim ntawv morse muaj cov kab lus luv thiab ntev ntev hu ua “dots” thiab “dashes”.

  • ib teev (.) yog 1 chav nyob hauv qhov ntev
  • dash (_) yog 3 chav nyob hauv qhov ntev
  • qhov chaw nruab nrab ntawm cov ntawv yog 1 chav
  • qhov chaw nruab nrab ntawm cov ntawv yog 3 chav nyob
  • qhov chaw nruab nrab ntawm cov lus yog 7 units

Peb tuaj yeem txiav txim siab seb lub suab nrov tuaj yog dot lossis qhov sib tsoo los ntawm kev sib piv nws lub sijhawm nrog lub suab siv ntawm 2 chav nyob hauv qhov ntev.

  • ib teev yog tsawg dua 2 units
  • tus lej yog ntau dua 2 units

Muaj ob txoj hauv kev sib txawv sib txawv rau kev txiav txim siab cov qauv nkag los ntawm dots thiab dashes:

  • nrhiav kab
  • tsob ntoo binary (tseem hu ua kev tshawb nrhiav dichotomic)

Nrhiav Kab

Ib txoj hauv kev yog los tsim cov cim ntawm cov cim thiab lawv cov qauv morse txuam. Piv txwv li txhua tus cim hauv qab no yuav raug cawm raws li:

  • A _
  • IB _…
  • C _ ua. _.
  • 0 _ _ _ _ _
  • 1. _ _ _ _
  • 2.. _ _ _

Txhua tsab ntawv xav tau 6 hlwb… 1 rau tsab ntawv nws tus kheej thiab 5 rau (.) Tus thiab (_) tus. Txhawm rau ua qhov no peb xav tau cov ntawv [36] [6] cov cim cim nrog rau tag nrho ntawm 216 hlwb. Cov hlwb tsis siv feem ntau tau sau nrog xoom lossis tsis muaj dab tsi.

Txhawm rau txiav txim siab cov khoom nkag thiab cov kab ntawv sib tw peb yuav tsum sib piv cov cim teev/qhov sib txawv ntawm txhua tsab ntawv tuaj nrog peb tus qauv siv tus cim.

Thaum txoj kev no ua haujlwm, nws qeeb heev.

Hais tias peb muaj 26 tus tsiaj ntawv ('A',.. 'Z') thiab tus lej ('0', … '9') khaws cia rau hauv ib qho array, tom qab ntawd peb yuav tsum ua 36 qhov kev tshawb nrhiav, txhua nrog txog 5 qhov kev tshawb nrhiav me me, uas yog tag nrho ntawm 36*5 = 180 tshawb nrhiav los txiav txim tus lej '9'.

Tsob Ntoo Binary

Kev tshawb nrhiav binary yog nrawm dua li tsis xav tshawb nrhiav.

Tsis zoo li kev tshawb nrhiav kab, uas yuav tsum muaj ob tus ua cim thiab morse tus qauv khaws cia, tsob ntoo binary tsuas yog khaws cov cim uas txhais tau tias qhov loj me me me.

Kuv tau faib kuv tsob ntoo binary (duab 1) ua ob ntu (duab 2 thiab 3) kom nws nyeem tau ntau dua.

Txhawm rau nrhiav tus cwj pwm peb txav tus pointer sab laug txhua lub sijhawm peb hnov lub suab thiab txav tus pointer kom raug txhua zaus peb hnov suab. Tom qab txhua qhov txav mus peb txo tus pointer nrug rau kev txav mus tom ntej … yog li lub npe tsob ntoo binary.

Txhawm rau txiav txim siab tsab ntawv '9' (dash, dash, dash, dash, dot) xav tau 5 txav … 4 mus rau sab xis, thiab 1 mus rau sab laug uas tso tus pointer ncaj qha rau ntawm '9'.

Tsib txav yog qhov nrawm dua 180 nrhiav !!!!!

Cov cim cim binary kuj tseem me dua … 26 ntawv thiab 10 tus lej tsuas yog xav tau 64 x 1 kab kab. Kuv tau xaiv los tsim 128 tus cim kab ntawv kom kuv tuaj yeem txiav txim siab cov cim cim cim.

Kauj Ruam 4: Tsim Cov Lus Cim

Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim
Sau Ntawv Tsim

Morse nyuaj rau kev txiav txim siab thaum pom cov teeb meem cuam tshuam. Cov cim tsis xav tau yuav tsum raug tsis lees paub … qhov no yuav tsum muaj qee yam lim.

Muaj ntau txoj hauv kev:

  1. Phase-xauv loops
  2. Inductor-capacitor lim
  3. Resistor-capacitor nquag lim
  4. Kev teeb tsa digital xws li Kev Hloov Kho Fourier Fast, lossis lim Goertzel.

Txoj Kev 1, 2, 3 xav tau cov khoom siv sab nrauv uas loj.

Txoj kev 4 yuav tsum tsis muaj cov khoom siv sab nraud … cov zaus tau kuaj pom siv cov lej lej.

Fast Fourier Hloov (FFT)

Ib txoj hauv kev txheeb xyuas qhov muaj lub suab nyob hauv cov txheej txheem nyuaj yog siv Fast Fourier Transform

Daim duab 1 qhia txog yuav ua li cas FFT (Fast Fourier Transform) faib lub suab nrov rau hauv “lub thoob”.

Daim duab 2 qhia pom tias FFT “lub thoob” teb rau lub teeb liab li cas… hauv qhov no 800Hz. Yog tias lub cim thib ob ntawm hais txog 1500Hz nyob tam sim no peb yuav pom ob qhov lus teb … ib ntawm 800Hz thiab lwm qhov ntawm 1500Hz.

Hauv txoj kev xav, tus lej morse tus lej tuaj yeem ua los ntawm kev saib xyuas cov qib tso tawm ntawm ib qho tshwj xeeb FFT zaus hauv… ib tus lej loj sawv cev ntawm qhov muaj tus cim lossis cim… tus lej me me sawv cev tsis muaj teeb liab.

Xws li tus lej morse tus lej tuaj yeem ua los ntawm kev tshuaj xyuas "bin 6" hauv daim duab 2 tab sis muaj ntau qhov tsis raug nrog txoj hauv kev no:

  • peb tsuas yog xav tau ib qho hauv lub hauv paus… qhov seem yog nkim sijhawm suav
  • lub thoob khib nyiab yuav tsis tshwm raws qhov xav tau ntau zaus
  • nws kuj qeeb (20mS ib Arduino voj ()

Lwm txoj hauv kev yog siv lub lim Goertzel.

Goertzel Lim

Goertzel lim zoo ib yam li FFT tab sis tsuas yog muaj ib zaug xwb tso rau hauv.

Daim duab 3 qhia txog kev teb zaus ntawm Goertzel lim rau cov suab tsis sib xws.

Daim duab 4 yog cheb ntawm cov lim tib yam ntawm tib qhov ntau zaus.

Kuv txiav txim siab "mus" nrog Goertzel algorithm li:

  • Lub voj Arduino () sijhawm siv Goertzel algorithm yog 14mS (milliseconds) piv rau 20mS (milliseconds) rau kev daws FFT siv Arduino "fix_FFT" tsev qiv ntawv.
  • Nws yog qhov yooj yim los teeb tsa qhov nruab nrab ntawm Goertzel bandpass lim.
  • Bandwidth yog kwv yees li 190Hz.

Daim duab 5 qhia txog cov lej tso tawm los ntawm 900Hz Goertzel lim thaum pom lub suab nrov. Kuv tau teeb tsa kuv lub suab pib rau tus nqi ntawm 4000… qhov tseem ceeb tshaj 4000 qhia lub suab.

Hauv kev xav koj tsuas yog yuav tsum tau kho koj lub lim kom mloog tau yooj yim. Hmoov tsis zoo lub suab tso tawm los ntawm kuv 1 nti saib xyuas tus neeg hais lus tau poob qis dua 900Hz. Txhawm rau zam qee qhov teeb meem Kuv siv lub lim lim ntawm 950Hz. Cov qauv tsim nyog rau kev suav lwm zaus lim dej muaj nyob hauv kuv tus lej kab ntawv.

Kev txiav txim siab

Kev txiav txim siab cov dots thiab dashes tsis yooj yim li nws xub pom.

Cov morse zoo meej tau txhais raws li:

  • dot = 1 chav
  • space hauv tsab ntawv = 1 unit
  • khiav = 3 units
  • qhov chaw nruab nrab ntawm cov tsiaj ntawv = 3 units
  • qhov chaw nruab nrab ntawm cov lus = 7 units

Txhawm rau txiav txim siab morse zoo tshaj peb tsuas xav tau lub suab siv sijhawm ntev ntawm 2 chav nyob

  • teev <2 units
  • qhov chaw <2 units
  • khiav ceev> 2 units
  • tsab ntawv _space> 2 units
  • word_space> 6 chav nyob (piv txwv li 3 x chav nyob)

Qhov no ua haujlwm rau tshuab morse tab sis hauv "ntiaj teb tiag":

  • qhov xa ceev sib txawv
  • lub sijhawm ntawm txhua tus teev sib txawv
  • lub sijhawm ntawm txhua qhov sib txawv nws txawv
  • cov ntawv E, I, S, H, 5 tsuas yog muaj cov ntawv teev uas qhov nruab nrab ntawm qhov teev sijhawm
  • cov tsiaj ntawv T, M, O, 0 tsuas yog muaj qhov sib npaug uas qhov nruab nrab rau lub sijhawm khiav ceev
  • lo lus khoob yuav tsis tuaj txog
  • fading tsim qhov tsis raug los ntawm qhov uas tus decoder yuav tsum rov qab los.
  • cov cim tsis ncaj vim cuam tshuam

Cov ntawv uas tsuas muaj tus lej thiab kab zauv raug tshem tawm yog tias:

peb kwv yees lub sijhawm siv kom txog rau thaum peb tau txais cov cim siv tau thiab qhov siv tau khiav ceev. Kuv siv 200 milliseconds uas siv tau yog tias xa nrawm yog nruab nrab ntawm 6 WPM (lo lus ib feeb) thiab 17 WPM. Koj yuav xav tau nce tus nqi no yog tias koj kawm morse. Lub rooj ceev tau suav nrog hauv software

Kev hloov pauv nrawm tau daws yog tias:

  • peb ua qhov nruab nrab dov ntawm txhua tus dot thiab txhua qhov sib tsoo thiab
  • rov xam dua qhov kev siv sijhawm tom qab tau txais txhua lub cim

Lo lus khoob thiab lo lus khoob tsis tuaj txog yog daws yog tias peb:

  • nco txog lub sijhawm ntawm qhov kawg ntawm qhov kawg (suab mus rau tsis muaj suab nrov) hloov pauv,
  • rov pib dua lub algorithm tom qab txhua tsab ntawv,
  • suav lub sijhawm dhau los thaum tos rau kev coj ua tom ntej (tsis muaj suab nrov rau lub suab nrov) hloov pauv thiab
  • ntxig ib qhov chaw yog tias ntau dua 6 lub sijhawm.

Tus Morse Oscillator

Kuv pib sim qee Piezo buzzers tab sis pom:

  • qhov zaus tau tsau
  • qhov tso zis ntau dhau rau mloog ntev
  • lub piezos tended kom drift tawm ntawm Goertzel passband

Tom qab ntawd kuv tau sim tsav lub suab hloov pauv nrog 750Hz squarewave tab sis pom nws muaj lub suab nrov uas lim tawm qhov thib 1 thiab thib 3. Daim duab 6 qhia txog lub suab tso suab ntawm lub microphone rau 750Hz square-wave … peb pom qhov sib haum xeeb thib 5 !!!

Tom qab ntawd kuv tau siv qhov siv tus hais lus me me. Daim duab 7 qhia txog lub microphone tso rau 750Hz squarewave uas tau xa mus rau tus hais lus me … lub sijhawm no peb pom qhov tseem ceeb … tsis yog qhov sib haum xeeb thib 5. Goertzel lim tsis quav ntsej ib qho kev sib haum xeeb.

Sau ntawv

[1]

en.wikipedia.org/wiki/Goertzel_algorithm

www.embedded.com/the-goertzel-algorithm/

Kauj ruam 5: Software

Software
Software
Software
Software
Software
Software

Kev teeb tsa

  • Rub tawm cov ntawv txuas nrog MorseCodeDecoder.ino [1]
  • Luam cov ntsiab lus ntawm cov ntawv no mus rau daim duab tshiab Arduino
  • Txuag cov duab kos ua "MorseCodeDecoder" (tsis hais cov lus)
  • Sau thiab xa cov duab kos rau koj Arduino

Software hloov tshiab 23 Lub Xya Hli 2020

Cov yam ntxwv hauv qab no tau ntxiv rau cov ntawv txuas "MorseCodeDecoder6.ino"

  • ib qho "Exact Blackman" qhov rai [2]
  • ib "Noise_blanker"

Kev Kho:

  • nce koj tus neeg txais lub suab kom txog thaum LED pib ntsais muag ces rov qab tawm
  • tam sim no qhib koj lub txais kom txog thaum LED flashes hauv kauj ruam nrog cov morse tuaj
  • Lub Suab nrov_blanker tau teeb tsa kom tsis quav ntsej lub suab nrov nrov mus txog 8mS (ib zaug ib zaug)
  • Lub suab nrov tuaj yeem hloov kho los ntawm teeb tsa Debug = muaj tseeb thiab saib koj Cov Ntawv Cuam Tshuam

Nco tseg

[1]

Teem koj Arduino Serial Monitor rau 115200 bauds yog tias koj xav tau ib yam nkaus li saib cov ntawv.

[2]

  • Duab 1… Qhov Tseeb Blackman qhov rai
  • Duab 2… Goertzel lim yam tsis muaj Blackman qhov rai
  • Duab 3,,, Goertzel lim nrog Qhov Tseeb Blackman qhov rai thov

Kauj ruam 6: Kev ua haujlwm

Decoder

Muab chav nyob ib sab ntawm koj tus neeg hais lus thaum mloog morse.

  • Lub tshuab hluav taws xob electret microphone khaws lub suab morse los ntawm koj tus neeg hais lus.
  • Qhov tso tawm ntawm lub tshuab electret microphone yog tom qab ntawd nthuav dav 647 zaug (56dB) ua ntej dhau mus rau Arduino rau kev ua.
  • Lub Goertzel digital bandpass lim tshem tawm cov teeb liab morse los ntawm lub suab nrov.
  • Kev txiav txim siab yog ua tiav siv tsob ntoo binary.
  • Cov lej txiav tawm tau tso tawm kom pom raws li cov ntawv ntawm 320 x 240 pixel TFT zaub. Nws tseem raug xa mus rau koj Arduino "Serial Monitor" yog tias koj tsis xav siv cov zaub.

Morse Xa ntawv

Ib tus morse sender kuj tau suav nrog. Qhov no tso cai rau koj los xyaum xa morse thiab ua haujlwm raws li hauv qab no:

  • Lub suab nrov tsis tu ncua tau tsim ntawm Arduino tus pin 4.
  • Peb hnov lub suab no los ntawm tus txiav txim lub suab nrov-hais lus thaum twg peb nias tus yuam sij yuam sij.
  • Lub suab tau teeb tsa kom zoo ib yam li Goertzel lim uas ua rau tus neeg txiav txim siab dag rau hauv kev xav nws mloog morse tiag … txhua yam koj xa yuav tshwm raws li cov ntawv luam tawm ntawm lub vijtsam.

Koj qhov kev xa yuav txhim kho raws li tus lej txiav txim siab khaws qhov ua yuam kev xws li:

  • ntau qhov chaw nruab nrab ntawm cov cim. (piv txwv: Q pinted li MA)
  • ntau qhov chaw nyob nruab nrab ntawm cov tsiaj ntawv (piv txwv: Tam sim no luam tawm tsis yog W)
  • tsis raug cai

Kauj ruam 7: Cov ntsiab lus

Decoder

Cov lus qhia no piav qhia yuav ua li cas thiaj ua tus lej txiav morse uas hloov pauv tus lej lej rau cov ntawv luam tawm.

  • Tus lej txiav txim siab muaj peev xwm txiav txim siab morse txog li 80 WPM (cov lus ib feeb)
  • Tus txiav txim siab txiav txim siab taug cov kev hloov pauv hauv qhov tau txais xa-nrawm.
  • Cov ntawv tau tshwm ntawm koj li Serial Monitor (lossis ntawm 320 x 240 TFT zaub module yog haum) [1]

Tus xa

Ib tus morse sender kuj tau suav nrog

  • Tus neeg xa khoom tuaj pab koj txhim kho qhov zoo ntawm koj cov morse xa.
  • Tus txiav txim siab lees paub tias yam koj tau xa yog raug

Tus nqi ntawm qhov

Tus nqi kwv yees ntawm morse tus lej txiav txim siab, tsawg dua qhov xaiv TFT zaub, yog $ 25.

Nyem qhov no mus saib kuv lwm cov ntawv qhia.

Suab Sib Tw 2020
Suab Sib Tw 2020
Suab Sib Tw 2020
Suab Sib Tw 2020

Qhov khoom plig thib ob hauv Kev Sib Tw Suab 2020

Pom zoo: