how can use fmmod function for make a LFM signal
4 次查看(过去 30 天)
显示 更早的评论
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
2 个评论
Salaheddin Hosseinzadeh
2014-8-18
Hi Mehdi,
What is the problem exactly?
Is it like the demodolator works perfect and you're not happy about it?!
采纳的回答
Salaheddin Hosseinzadeh
2014-8-18
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');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175411/image.png)
3 个评论
Salaheddin Hosseinzadeh
2014-8-18
编辑:Salaheddin Hosseinzadeh
2014-8-18
You're welcome.
I'll have a look at what you've done to add noise, and see why id doesn't work.
I'll post something in 1 2 hours hopefully, as soon as I got home ;)
By looking at this image, my guess is that you're adding to much noise. But as I said, I'll have a precise look.
更多回答(2 个)
Salaheddin Hosseinzadeh
2014-8-19
Hi Mehdi,
It's always a pleasure for me to get involve telecom problems, besides, it's a good review and still a struggle for me. Hamvatan ham ke hasti, dige hanoz pleasuresh bishtare :D
To avoid any confusion I used awgn function. It's a built in MATLAB function, read about it in the MATLAB documentation for further info. (doc awgn)
clear
Fs = 800; % Sampling rate of signal
Fc = 30; % Carrier frequency
t = [0:Fs-1]'/Fs; % Sampling times
x = sin(2*pi*2*t); % Channel 1
dev = 20; % Frequency deviation in modulated signal
y = fmmod(x,Fc,Fs,dev); % Modulate both channels.
y2 = awgn(y,20,'measured'); % 20dB
figure
plot(t,y2,'r')
hold on
z = fmdemod(y2,Fc,Fs,dev); % Demodulate both channels.
plot(t,z);
legend('Modulated Signal','Demodulated Message');
Hope this solves the problem for now, but it would be a good practice I guess for both of us to perform what awgn function does. So Plz leave comment as soon as you got the same result without using awgn and explain for me how u did it. Thanks
Regards,
Salah
Salaheddin Hosseinzadeh
2014-8-18
Hey Mehdi,
Sorry, I guess it took me a bit more than 2 hours, I've been a bit busy.
Take a look the attached file and how I add noise to the signal.
Considering message is a sine wave, it's between -1 and 1, then for SNR = 10dB which means signal has an amplitude of 10 times greater than noise level adjusted to be between 0.1 and -0.1 , which gives SNR = 10dB, and then I add that to the modulated signal.
Anyway, hope your problem is solved.
Don't hesitate to write back.
Good Luck,
Salah
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175412/image.png)
3 个评论
Salaheddin Hosseinzadeh
2014-8-19
编辑:Salaheddin Hosseinzadeh
2014-8-19
Hi Mehdi,
That's good, looks like you paid attention to what's happening!
You may be right also, I totally forgot the power 2, I assumed summation of the message signal(sine wave) is zero, the summation of a normal distribution (Gaussian Distribution) is also zero so that should not make a problem! Maybe I'm wrong!
I'll have a look at your code again. Don't doubt MATLAB functions plz, I've faith in MATLAB. It's probably you and I making small mistakes ;)
Regards,
Salah
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!