資源簡介
循環譜的仿真代碼 自己編寫的FAM,經運行之后是正確的
代碼片段和文件信息
?%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?***?Estimator?using?the?cyclostationary?time?smoothing?FFT?Accumulation?Algorithm.***
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Getting?input?data?from?the?global?variables?generated?by?GUI?cyclo_s.m?and?calculating?constants
%?present_directory?=?cd;?%?Save?present?directory?to?a?variable?to?make?the?GUI?go?back?to?it?in?the?end
%?path?=?handles.edit3;?%?Saving?the?path?information?in?a?variable
%?filename?=?handles.edit1;?%?File?to?be?analyzed?from?GUI?generated?global?variable?handles.edit1
%?fs?=?handles.edit2;?%?Sampling?frequency?from?GUI?generated?global?variable?handles.edit2
%?df?=?handles.popupmenu1;?%?Frequency?Resolution?from?GUI?generated?global?variable?handles.popupmenu1
%?M?=?handles.popupmenu2;%?2;?%?df/dalpha?=?M?>>?1?(reliability?condition)
%?data_path?=?[path‘\‘filename];
%?load?(data_path);?%loading?file?to?be?analyzed?from?specified?path
%?修改后不用GUI界面
clc;close?all;clear?all;
%%
%?T=100;
%?delta_f=1/(100*T);
%?ts=delta_f;
%?fs=1/ts;
%?df=128;
%?M=4;
%?dalpha?=?df/M;
%?f=-5/T:delta_f:5/T;
%?sgma_a=1;
%?Sv=sgma_a^2*sinc(f*T).^2;
%?f1=2000;
%?Sv=Sv.*exp(j*2*pi*f1*f);
%?x=Sv;
%?plot(abs(fft(x)))
%%
clc
clear?all
close?all
fs=4000;
fc=1000;
fd=200;
M=64;
df=128;
dalpha?=?df/M;
M1?=?4;
x1?=?randint(5001);
h?=?modem.pammod(‘M‘?M1);
y1=modulate(hx1);
y=?rcosflt(y1fdfs‘fir‘);
t=(0:length(y)-1)/fs;
x=y.*cos(2*pi*fc*t)‘;
%%
%?%?filename=‘testcs1‘;
%?fs=7000;
%?M=4;
%?dalpha?=?df/M;
%?%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?fd?=?1000;
%?fc?=?1e+3;?%?Carrier?frequency
%?K=100;
%?%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%BPSK?modulation.
%?Q=4;
%?x?=?randint(K1[0Q-1]);
%?x?=?dmod(xfcfdfs‘psk‘Q);
%?Defining?parameters
Np?=?pow2(nextpow2(fs/df));?????????%?Initially?it?is?the?number?of?rows?in?the?channelization?matrix?(X)?or
????????????????????????????????????%?the?number?of?input?channels?defined?by?fs/df?
????????????????????????????????????
L?=?Np/4;???????????????????????????%?Overlap?factor?in?order?to?reduce?the?number?of?short?time?fft‘s
????????????????????????????????????%?L?is?the?offset?between?points?in?the?same?column?at?consecutive?rows
????????????????????????????????????%?should?be?less?than?or?equal?to?Np/4?(Prof.?Loomis?paper)
????????????????????????????????????
P?=?pow2(nextpow2(fs/dalpha/L));????%?Number?of?columns?formed?in?the?channelization?matrix?(X)
N?=?P*L;????????????????????????????%?Total?number?of?points?in?the?input?data?to?be?processed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%???Input?channelization?-?this?part?limits?the?input?total?number?of?points?to?be?analyzed.?It?also?generates?a?Np?X?P?matrix
%?(X)?with?shifted?versions?of?the?input?
評論
共有 條評論