通信基础-Digital and Analog Modulation With Polar Code and Frequency Hopping

All Code can be found in Github

Digital Modulations and Analog Modulations including 2FSK\4QAM\4PSK\2ASK and AM\DSB\SSB\FM.

There are Polar code and frequency hopping in Digital Modulation.

Especially, due to the imperfect character of digital filter, the simulation of 2FSK does not match the theoretical values. The difference will vanish with the decreased number of frequencies selected in frequency hopping.

Digital Modulations

QPSK

decd46a10e4237aff3048222793848a

2ASK

d53b5853c39d163163f835c4059b947

2FSK

da402ee4c27ddd3f2e27e562eb6b8b1

==(No longer envelope detection)==

 for p=1:1:length(st1)/sps
    for is = sps*(p-1):sps*(p)-1
        st1_sum(p) = st1_sum(p)+st1(is+1);
        st2_sum(p) = st2_sum(p)+st2(is+1);
    end
end
rx_data = (st1_sum-st2_sum);

4QAM

a940b5d5779316e9e05e8e7b8dbe19e

Analog Modulations

AM

889aaf78e35af52c2a35489fa447c5a

Refer to《通信原理》-第七版(樊昌信)Page 87

It should satisfy and then we can use envelope detection

DSB

9eb6e312bb328814357b3fbf99de153

SSB

Refer to

image-20230327152726140

image-20230327152714021

a1a6e44169f9c3a43d61b8664bb7db7

FM

b3b580ca7fc4769612aee4ed9decdee

Notes

Sampling a stream of data with a small sampling rate will fold the signal, which means:

.But in 2FSK, we found that:

  • If is even, it holds,
  • If is odd, it should be

We use digital filter in matlab and there will be a time delay. It can be calculated as:

function out = firFilter(N, Wn, data)
    fir_lp =fir1(N, Wn, 'low'); %截止频率为Wn*(fs/2) 使用汉明窗设计一个N阶低通带线性相位的FIR滤波器。
    out = conv(fir_lp,data);
    delay_t = round((length(fir_lp)-1)/2);  %低通滤波器的延迟时长
    out = out(delay_t+1:end-delay_t);
end

Conversion between EbN0 and SNR:

EbN0 = 0:1:20; % Eb是每个bit的能量,N0是噪声的功率谱密度;EbN0=Eb/N0;
snr = EbN0 - 10*log10(sps*1/2)+10*log10(log2(M)); % SNR和EbN0转换

image-20230504151349128