Communication algorithm nine: 4FSK modulation and demodulation simulation link

Source: Internet
Author: User
Tags cos sin

A. 4FSK principle

DMR System, digital trunking communication system. The DMR protocol adopts a modulation mode of 4FSK, which is a constant envelope modulation, which transmits 2,400 symbols per second and each symbol carries two bits of information. The maximum frequency offset d is defined as follows:d = 3h/2t,h represents the frequency offset factor for each modulation, 0.6. The t indicates the symbol period, which is 1/2400. d=2160.

The 4FSK modulator consists of a square-root ascending cosine filter cascade a frequency modulator. The first part is the forming filter module, which produces a four-level baseband band-limited signal as a modulated signal. The second part is the frequency hopping part FM.

Frequency modulation is a kind of angle modulation, the angle modulation is generally expressed as: Sm (t) = Acos (Wc (t) +). The frequency modulation is obtained by the carrier frequency of baseband signal, i.e. the linear change of the signal m (t) of the instantaneous frequency offset Tiaogan system. Meet: =KF.M (t). Among them, KF is the frequency offset constant.

Two. 4FSK modulation signal generation

There are two main kinds of modulation signals, direct method and indirect method. The indirect method achieves high cost and complexity. Direct modulation is modulated signal m (t) directly control the frequency of the oscillator so that it changes linearly according to the modulation signal law. The orthogonal modulation of FM signal is an implementation method of indirect FM.


Three. 4FSK modulation and demodulation algorithm design flow

Transmitter Design:





Receiver Design:






Four. MATLAB emulation link


%****************************************************************
% Content Overview: 4FSK modulation and 4FSK demodulation emulation link
% emulation Link:
% Creator:
% created: October 23, 2014
% modified: October 28, 2014 Debug through Ideal environment
% modified: October 31, 2014 Gaussian white noise channel debug through
% modified: November 2, 2014 Gaussian white Noise channel, has a phase difference, has the frequency partial DC component environment debugging passes
% references: DMR communication system various engineering realization literature
% copyright notice: Not to be reproduced at will and not freely disseminated.
%****************************************************************
CLC
Clear all;
Close all;

Snr = (16:0.5:22);% signal-to-noise ratio (theory 15.6dB)
Berebno = Zeros (1,length (SNR));

For Nen=1:length (SNR)
Err_counter = 0;
For nframe=1:10000

%----------------The physical layer baseband algorithm of the sending end---------------------------------------
%-1. Input baseband signal-source bit sequence-string and transform-map-----------------------------------
Lenthbit = 264;
Lenthsample = 132;
Sourcebit = Randint (1,lenthbit); % bit Rate 4.8kb/s
SourceData = Bitstopyinshe (sourcebit,lenthsample);% symbol Rate 2.4ksymbol/s
Figure ()
Stem (SourceData (1:80), ' m ');
Grid on;
Axis ([0 80-4 4]);
%-2. Forming filter-L-cosine filter-------------------------------------------------
%-includes: eight times times interpolation and RMS-to-cosine forming filter to reduce baseband signal bandwidth consumption
Fd = 1;
Fs = 8;
Type = XX;
Rolloff = XX;
Delay = XX; % baseband signal m (n) rate 19.2 k/s
Fsksignal = Squrootcosfilter (Sourcedata,fd,fs,type,rolloff,delay);
Figure ()
Plot (Fsksignal (1:600), ' m ');
Grid on;
%-----------------------above is the physical layer baseband algorithm of the sending end--------------------------
%--------------------The physical layer if algorithm of the transmitting end digital up-conversion-------------------------
%-3. Phase Summation summation-----------------------------------------------------------
Phase = Phasesum (fsksignal);
%-4. Phase sin (.) -cos (.) ------------------------------------------------------
%-symbol rate 2.4kbps, symbol period T, modulation factor H, maximum frequency offset d:d = 3h/2t
T = 1/2400;
H = 0.27;
D = (3*h)/(2*T);
Ts = 1/(2400*8);
factor = 2*pi*d*ts;
[II QQ] = Phasesincos (phase,factor);
%-5. Digital intermediate Frequency-digital up-conversion-interpolation filter-cic-hb-fir---------------------------------
% according to the Nyquist sampling theorem, the sampling frequency FS should be greater than 2*FC+BM. In practical applications, it is generally
% sampling frequency FS is greater than or equal to four times times the analog signal frequency. FS >= 4*FC
% "to be developed digital if algorithm: Cic-hb-fir, Symbol rate: 4*FC"
%-6. Digital intermediate Frequency-digital up-conversion-carrier system-sin (wc*t)--cos (wc*t)------------------------
% "developed digital If algorithm: quadrature, Carrier modulation"
% s (t) = A*cos (2*pi*fc*t) *i (t)-A*sin (2*pi*fc*t) *q (t)
%--------------------above the transmit-side physical layer if algorithm digital up-conversion----------------------


%-7. Spatial channel transmission-Gaussian white noise channel---------------------------------------------
Figure ()
Plot (II (500:800), ' m ');
Grid on;
Title (' Signal before the ' high-white Noise channel ');
II = AWGN (Ii,snr (NEN));
QQ = AWGN (Qq,snr (NEN));
Figure ()
Plot (II (500:800), ' m ');
Grid on;
Title (' Signal after the ' high-white Noise channel ');

%-8. Digital intermediate Frequency-digital down-conversion-quadrature demodulation algorithm----------------------------------------
% SI (t) = s (t) *cos (2*pi*fc*t) SQ (t) = s (t) *sin (2*PI*FC*T)
% interpolation filter-cic-hb-fir
%-9. Digital intermediate Frequency-digital down-conversion-decimation filter-------------------------------------------
% "pending development, digital down-conversion algorithm decimation filter"

%-10. Spatial channel transmission-plus phase difference value-----------------------------------------of the frequency-increase offset value
Sigcomplex = II +1j*qq;
freq_offset = 1000;% frequency offset f=1000hz
Phase_offset = PI/4;%%PI/4; phase offset
Pphh = (...)...........);
Newsig = SIGCOMPLEX.*PPHH;
II = Real (Newsig);
QQ = Imag (Newsig);
Figure ()
Plot (II (500:800), ' m ');
Grid on;
Title (' Signal ' after the ' High white noise channel/phase difference/frequency difference ');
%-11. Phase estimation, difference, difference algorithm--eliminating the problem of local carrier and signal difference in coherent demodulation
m = Phasechajiuzheng (Ii,qq,factor);
Figure ()
Plot (M (257:657), ' m ');
Grid on;
Title (' Signal not matched filter ');
% axis ([0 160-1 1]);
%-12. Matching filter-----------------------------------------------------------
mx = pipeimatchfilter (M,rolloff,delay,fs,fd,type);
Figure ()
Plot (MX (1:300), ' m ');
Grid on;
Title (' Signal after matching filtering ');
% axis ([0 160-1 1]);


%-13. Signal standard threshold-dynamic range determination------------------------
%-determining the Dynamic range---Calculate standard Thresholds---------------------------

[Up-down mid mean]=signaldynamicrange (MX);
[Up_level_std mid_level_std Down_level_std]=signalbiaozhunrange (Up,down,mean);
%-14. Symbol synchronization algorithm-determine the best decision point, recorded as SYN---remove the DC component algorithm, remove F
[Msigle I] = Synsampledingshi (Mx,mean);

%-16. Threshold decision, inverse mapping--------------------------------------
Dataout = Zeros (1,2*length (Msigle));
For KK = 1:length (msigle)
If Msigle (KK) > UP_LEVEL_STD
Dataout (2*KK-1:2*KK) = [0 1];%3
ElseIf (Msigle (KK) <= up_level_std) && (Msigle (KK) > MID_LEVEL_STD)
Dataout (2*KK-1:2*KK) = [0 0];%1
ElseIf (Msigle (KK) <= mid_level_std) && (Msigle (KK) > DOWN_LEVEL_STD)
Dataout (2*KK-1:2*KK) = [1 0];%-1
Else
Dataout (2*KK-1:2*KK) = [1 1];%-3
End
End
[Errnum,errrate] = Biterr (sourcebit,dataout);
If Errnum ~= 0
Index = Find (sourcebit ~= dataout);
DISP ([' ERROR bit position = ', Num2str (Index), ' Symbol Sync syn= ', Num2str (I)]);
End
Err_counter = Err_counter + errnum;
Ber = Err_counter/nframe/lenthbit;
End
Berebno (NEN) = Ber;
fprintf (' Ecno:%1.2fdb, ber:%8.4e,\n ', SNR (NEN), BER);
End
Semilogy (snr,berebno, ' b-v ');
Grid on;
Xlabel (' ec/no[db] ');
Ylabel (' Bit Error rate ');
Title ('--4fsk modulation and demodulation simulation ber curve-');
Disp ('--4FSK modulation, end of 4FSK demodulation simulation-');
%---------------------------------------------


Five. Simulation graphics









"Detailed information, and the corresponding MATLAB code, consulting QQ: 1279682290 "


Communication algorithm nine: 4FSK modulation and demodulation simulation link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.