Is My MATLAB Program for AM and FM Correct?

  • Context: MATLAB 
  • Thread starter Thread starter kidd
  • Start date Start date
  • Tags Tags
    Fm Matlab
Click For Summary
SUMMARY

The MATLAB program provided simulates both Amplitude Modulation (AM) and Frequency Modulation (FM) waveforms. For AM, it uses parameters fm=20Hz, fc=500Hz, Vm=1V, and Vc=1V, while for FM, it employs fm=250Hz, fc=5000Hz, Vm=1V, and Vc=1V. The program generates time-domain and frequency-domain plots for both modulation types, effectively demonstrating their characteristics. The discussion emphasizes the importance of understanding each code segment in relation to communication theory concepts.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of Amplitude Modulation (AM) and Frequency Modulation (FM)
  • Knowledge of Fourier Transform and its application in signal processing
  • Basic concepts of time-domain and frequency-domain analysis
NEXT STEPS
  • Explore MATLAB's FFT function for advanced signal processing techniques
  • Learn about the impact of modulation index on AM and FM signals
  • Investigate the effects of noise on AM and FM signal transmission
  • Study the practical applications of AM and FM in real-world communication systems
USEFUL FOR

Students and professionals in electrical engineering, signal processing, and communications who are looking to deepen their understanding of modulation techniques and MATLAB programming.

kidd
Messages
14
Reaction score
0
The question is like this:
a.The amplitude modulation(AM)waveform in time and frequency domain.
fm=20HZ,fc=500HZ,Vm=1V,Vc=1V,t=0:0.00001:0.09999

a.The frequency modulation(FM)waveform in time and frequency domain.
fm=250HZ,fc=5KHZ,Vm=1V,Vc=1V,m=10,t=0:0.00001:0.09999

Then my program is like this:
% setting
fm=20;
fc=500;
vm=1;
vc=1;
interval=0.001;
% x-axis:Time(second)
t=0:0.00001:0.09999;
f=0:1:9999;

% y-axis:Voltage(volt)
wc=2*pi*fc;
wm=2*pi*fm;
V1=vc+vm*sin(wm*t);
V2=-(vc+vm*sin(wm*t));
Vm=vm*sin(wm*t);
Vc=vc*sin(wc*t);
Vam=(1+sin(wm*t)).*(sin(wc*t));
Vf=abs(fft(Vam,10000))/10000;

% Plot figure in time domain
figure;
plot(t,Vam);
hold on;
plot(t,V1,'r'),plot(t,V2,'r');
title('AM waveform time-domain');
xlabel('time'), ylabel('amplitude');
grid on;

% Plot figure in frequency domain
figure;
plot(f*10,Vf);
axis([(fc-2*fm) (fc+2*fm) 0 0.6]);
title('AM waveform frequency-domain');
xlabel('frequency'), ylabel('amplitude');
grid on;

%Plot modulating signal
figure;
plot(t,Vm);
title('AM modulating signal');
xlabel('time'), ylabel('amplitude');
grid on;

%Plot carrier signal
figure;
plot(t, Vc);
title('AM carrier signal');
xlabel('time'), ylabel('amplitude');
grid on;
clear;

Is it correct?It is AM program.If it is wrong can u help me correct it?

% setting
vc=1;
vm=1;
fm=250;
fc=5000;
m=10;
% x-axis:Time(second)
t=0:0.00001:0.09999;
f=0:10:99990;

% y-axis:Voltage(volt)
wc=2*pi*fc;
wm=2*pi*fm;
sc_t=vc*cos(wc*t);
sm_t=vm*cos(wm*t);
kf=1000;
s_fm=vc*cos((wc*t)+10*sin(wm*t));
vf=abs(fft(s_fm,10^4))/5000;

% Plot figure in time domain
figure;
plot(t,s_fm);
hold on;
plot(t,sm_t,'r');
axis([0 0.01 -1.5 1.5]);
xlabel('time(second)'),ylabel('amplitude');
title('FM time-domain');
grid on;

% Plot figure in frequency domain
figure;
plot(f,vf);
axis([ 0 10^4 0 0.4]);
xlabel('frequency'), ylabel('amplitude');
title('FM frequency-domain');
grid on;

%Plot modulating signal
figure;
plot(t,sm_t);
axis([0 0.1 -1.5 1.5]);
title('FM modulating signal');

This is FM.

And can let me know what can i get discussion and conclution from this two program?I not very sure i understand what is it doing...:cry:
 
Physics news on Phys.org
I wrote a similar program when I had communication theory. My recommendation is to write your code in conjuction with your class notes. As you work through each small set of code, make the lines you are still unsure about; output to the screen or to a file (though I am not sure how you wrote program lines before understanding their meaning). Then as you gain confidence with each set of code, string them together to construct the complete simulation.

You discuss what your program does and how it simulates a real world application. You conclude how well does your program do what you set out to accomplish. You want to elaborate on this, so that you cover all the important points.
 
Last edited:

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K