1.算法概述
Interference : 200KHz
Signal source: 需要在給出的一個excel 文檔里調(diào)用,我對應(yīng)的信號是第二豎欄,就是從B1到B60
里面所有的filter(濾波器)都是自己來選值,但必須和圖里要求的一樣,band-pass filter 只能用帶通濾波器,不可用其他代替。Low-pass filter(低通濾波器)是同樣的道理。
Scaling factor為-20,
Noise為隨機向量*0.3,
Interference為200khz。
這個部分主要分為放大器,帶寬濾波器,載波解調(diào),原始的信號。
2.仿真效果預(yù)覽
matlab2022a仿真








3.MATLAB部分代碼預(yù)覽
.................................................
%STEP1 發(fā)送端
%信號源
SINGNALS=xlsread('Signals.xls','Sheet1','B1:B600');
figure(1)
subplot(511),plot(SINGNALS),title('原始的信號');
%乘以載波
N = 20 ??????????????????????% Set the number of signal samples
Freq = 250000; ????????????????% 250k
dt = 1/(N*Freq); ??????????????% Set the sample time
SimTime = 600/Freq; ?????????????% Set simulation time to 3 periods of the signal
t = dt:dt:SimTime; ?????????????% Create Time vector(from 0 upto SimTime)
Carrier= sin(2*pi*Freq*t); ?
subplot(512),plot(Carrier),title('調(diào)制載波');
%信號采樣化
for i = 1 : length(Carrier)-1
SINGNALS1(i) = SINGNALS(floor(i/20)+1);
end
SINGNALS1(length(Carrier)) = SINGNALS1(length(Carrier)-1);
SINGNALS2=SINGNALS1.*Carrier;
% SINGNALS2=SINGNALS1.*Carrier + SINGNALS1.*Carrier.*Carrier;
subplot(513),plot(SINGNALS2),title('信號調(diào)制信號');
%放大
SINGNALS3=15*SINGNALS2;
subplot(514),plot(SINGNALS3),title('模擬放大信號');
%帶通濾波器
order = 4;
wn = [0.01 0.1];
[B,A]=butter(order,wn);
SINGNALS4 = filter(B,A,SINGNALS3);
subplot(515);plot(SINGNALS4),title('帶通濾波后的信號');
%STEP2 信道
figure(2)
alpha = -20; ??????????????????????????????% scaling factor
noise = 0.3*randn(1,length(SINGNALS4)); ???% Generate a random number
subplot(211);plot(noise);
N2 = N; ???????????????????????????????????
Fre = 200000; ?????????????????????????????% Set the frequency of the signal
dt2 = 1/(N2*Fre); ?????????????????????????% Set the sample time
SimTime2 = 600/Fre; ???????????????????????% Set simulation time to 3 periods of the signal
t2 = dt2:dt2:SimTime2; ????????????????????% Create Time vector(from 0 upto SimTime
interference = sin(2*pi*Fre*t2); ??????????% Determine the sinusoidal function for interference
output_sig ??= SINGNALS4.* alpha;
SINGNALS5 = output_sig + noise + interference;
subplot(212);plot(SINGNALS5);
%STEP3 接收端
figure(3);
a2=6;
SINGNALS6 = a2*SINGNALS5;
order2 = 4;
wn2 = [0.01 0.1];
[B2,A2]=butter(order2,wn2);
SINGNALS7 = filter(B2,A2,SINGNALS6);
subplot(311);plot(SINGNALS7),title('接收端后的低通濾波信號');
SINGNALS8=-SINGNALS7.*Carrier; ?
% SINGNALS8= SINGNALS7.*Carrier;
subplot(312);plot(SINGNALS8),title('解調(diào)信號');
wn1 = 0.1;
order1 = 10; % Filter Order
[C,D] = butter(order1,wn1,'low'); % create the fourth order butterworth filter
SINGNALS9 = filter(C,D,SINGNALS8);
subplot(313);plot(SINGNALS9),title('還原后的信號');
figure(4)
subplot(211);plot(SINGNALS);title('系統(tǒng)發(fā)送接收信號的對比');
subplot(212);plot(SINGNALS9);axis([0,length(Carrier),0,5000]);
01-29m