FM调制信号表示如下,其实质是差分频率调制,即该sample的频率是前一个sample的频率加上调制信号变化量,具体表现为每个sample相位的变化。
假设| x(t) | ≤ 1,则fd是相对于中心频点的最大频偏。当x(t)恒等于1时,等效为上变频fd。
FM调制通常会拓展频谱,这是因为频率调制的本质是搬频,占用带宽为最大的搬频距离加上基带带宽,即R+2*fd,其中R为基带信号带宽(符号速率),调制因子dm=fd/fmax,fmax=R/2,| x(t) | ≤ 1
FM解调使用差分解调,提取相位变化量。
根据FM调制原理,t时刻调制的相位为
2*pi*fd* x(t-1)/fs+2*pi*fd*x(t)/fs
其中dt = 1/fs,相位增量为2*pi*fd*x(t)/fs,需要满足在[-pi pi]的范围内,即x(t)*fd/fs的绝对值应小于0.5,否则会造成相位溢出失真。
在保证相位无失真的情况下调整x(t)的增益可直接调整调制信号带宽。
FM实现需要框图如下,解调时的fs可以不等于调制时的fs,具体通过延时N来调整,不能让相位溢出
频谱仿真
%% Plot Spectrum of FM Modulated Baseband Signal
% Apply FM baseband modulation to BPSK source and plot its
% spectrum.
clearclose all
% Set the example parameters.
fs = 20e3 % Sample rate (Hz)
ts = 1/fs % Sample period (s)
Rs = 1e3 % Baseband symbol rate
dm = 1 % FM modulation factor
fd = Rs/2*dm % Frequency deviation (Hz)
Nup = fs/Rs % Up-sampling times
%%
% Create a BPSK symbol source having a duration of 1s.
%%
Nsymb = 1*Rs
symbBpsk = (randi([0 1],Nsymb, 1)-0.5)*2
%%
% Upsampleing BPSK symbol to fs and shape it by Raised cosine FIR pulse-shaping filter
%%
rrcFilter = rcosdesign(0.25,20,Nup,'norm')
dataRrcIn = upsample(symbBpsk,Nup)
dataRrcTemp = conv(dataRrcIn,rrcFilter)
NtailRrc = floor(length(rrcFilter)/2)
dataRrcOut = dataRrcTemp(NtailRrc+1:end-NtailRrc)
% Scale power, normalise the power of optimum sampling point, the scale
% of FM input signal will directly determine FM bandwidth
xOptSamp = dataRrcOut(1:Nup:end)
plot(xOptSamp,'*')
x = dataRrcOut/mean(abs(xOptSamp))
plot(x,'*')
%%
% Create an FM modulator System object and modulate the input signal.
%%
MOD1 = comm.FMModulator('SampleRate',fs,'FrequencyDeviation',fd)
y = step(MOD1,x)
%%
% Create another modulator object, |MOD2|, whose frequency deviation is
% two times larger and apply FM modulation.
%%
MOD2 = comm.FMModulator('SampleRate',fs,'FrequencyDeviation',2*fd)
z = step(MOD2,x)
%%
% Plot the spectra of the two modulated signals. The larger frequency deviation
% associated with channel 2 results in a noise level that is 10 dB higher.
%%
SA = dsp.SpectrumAnalyzer('SampleRate',fs,'ShowLegend',true)
step(SA,[x y z])
%%
调整信号大小仿真
% FM link
clearclose all
fb = 1e3
dm = 1
fd = Rs/2*dm % Frequency deviation (Hz)
fs = 8e3
Nup = fs/fb
data = (randi([0 1],1000, 1)-0.5)*2 % BPSK
figureplot(data,'-*')
% 成型滤波器
rrcFilter = rcosdesign(0.25,20,Nup,'norm')
dataRrcIn = upsample(data,Nup)
dataRrcTemp = conv(dataRrcIn,rrcFilter)
NtailRrc = floor(length(rrcFilter)/2)
dataRrcOut = dataRrcTemp(NtailRrc+1:end-NtailRrc)
dataIn = dataRrcOut/mean(abs(dataRrcOut)) % Scale power
% 调制相位需要控制在[-pi pi],否则会造成相位失真,即 dataIn*fd/fs的绝对值不能超过0.5
dataIn = dataIn*fs/fd*0.5
maxDelta = max(abs(dataIn*fd/fs))
FMMethod = comm.FMModulator('SampleRate',fs,'FrequencyDeviation',fd)
modSymb = step(FMMethod,dataIn)
FMDeMethod = comm.FMDemodulator('SampleRate',fs,'FrequencyDeviation',fd)
demodSymb = step(FMDeMethod,modSymb)
isequal(fi(dataIn,1,13,10),fi(demodSymb,1,13,10))
return
% my function
addTemp = 0
for i = 1:length(dataIn)
addTemp = dataIn(i)+addTemp
modPhase(i,1) = 2*pi*fd*addTemp*(1/fs)
end
modSymbOut = exp(1j*modPhase)
dataDemodIn = modSymbOut
% demod
dataDemodOut(1,1) = angle(dataDemodIn(1))/(2*pi*fd/fs)
Ndelay = 1
for i = 1:length(dataDemodIn)-Ndelay
deltaPhase = dataDemodIn(i+Ndelay)*conj(dataDemodIn(i))
dataDemodOut(i+1,1) = angle(deltaPhase)/(2*pi*fd/fs)
end
isequal(fi(dataIn,1,13,10),fi(dataDemodOut,1,13,10))
先得信号的相位,unwrap 校正相位角,使相位在整体上连续,diff对该相位角求导至于线性计算部分跟你的调制公式有关系的,不一定。u=cos(2*pi*fc*t+2*pi*kf*int_m)
int_m是0—t区间内对信号函数的积分。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)