MATLAB: How can use fmmod function for make a LFM signal

fmmod with noise

i can make LFM signal with this function look my program , but when noise increase to modulated signal, the demodulator out put isn't desirable just for very high SNR such as 100dB!!!???
close all
clear all
clc
%**************** linkbudget
fd=1000; %doppler freq
fs=1e6; %frequency sampling
fc=1e3;
T=1e-2; % one period
B=2e4; %bandwidth
SNR_db=10;
f_dev=1;
%**************
snr=10^(SNR_db/10);
t=-T/4:1/fs:T/4;
x=B/2*tripuls(t,T/2);
figure
plot(t+T/4,x)
x2=fd+x;
y=fmmod(x2,fc,fs,f_dev);
pn=sum(y.^2)/snr;
y2=y+sqrt(pn).*randn(1,length(t));
z=fmdemod(y2,fc,fs,f_dev);
hold on
plot(t+T/4,z,'g')
figure
plot(t,y2);
to see the true output change line 11 to SNR_db=100

Best Answer

Hey Mehdi,
I ran your code, couldn't understand anything really.
Try this one, you may see some modulation taking place at least, and then lets try to discuss what the problem is.
Fs = 8000; % Sampling rate of signal
Fc = 30; % Carrier frequency
t = [0:Fs-1]'/Fs; % Sampling times
s1 = sin(2*pi*2*t); % Channel 1
x = s1; % Two-channel signal
dev = 20; % Frequency deviation in modulated signal
y = fmmod(x,Fc,Fs,dev); % Modulate both channels.
plot(t,y,'r')
hold on
z = fmdemod(y,Fc,Fs,dev); % Demodulate both channels.
plot(t,z);
legend('Modulated Signal','Demodulated Message');
Related Question