Error using fmmod -> X must be real.

3 views (last 30 days)
Martin
Martin on 13 Nov 2013
Hi everybody!
My school thesis is about simulation of communication between mobile station and LTE type 2. Well, I have tried to load a sound over function audioread, then I have wanted to make some discrete image of that and modulate it afterward. Okay, I have let to use the Fourier transform y=fft(x) and I have tried to modulate it with frequency modulation fmmod(). However something went wrong and it doesn't work already. Matlab notices an error.
. . .
Error using fmmod -> X must be real.
Error in Semestralni_prace_MKS -> y2m = fmmod(fy,F_car,F_samp,freqdev);
. . .
Source code:
%%Loading of a sound
[y,Fs] = audioread('song.wav');
%%Signal sampling over FFT
fy = fft(y);
%%Modulation
F_samp = 8000; % Sampling rate of signal
F_car = 3000; % Carrier frequency
t = (0:F_samp-1)'/F_samp; % Sampling times
freqdev = 50; % frequency deviation
y2m = fmmod(fy,F_car,F_samp,freqdev);
%%Demodulation
y2d = fmdemod(y2m,F_car,F_samp,freqdev);
%%Backward transformation of signal
y2 = ifft(y2d);
...
What is wrong? How to make it better? Thank you for reply!! I am a Matlab beginner, be patient with me.. :))

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!