0% found this document useful (0 votes)
11 views3 pages

Combined Code

The document outlines a MATLAB script for generating and analyzing amplitude modulation (AM) signals. It includes the creation of carrier and modulating signals, their combination to form an AM signal, and the subsequent demodulation process. The script also features visualizations of the signals in both time and frequency domains.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Combined Code

The document outlines a MATLAB script for generating and analyzing amplitude modulation (AM) signals. It includes the creation of carrier and modulating signals, their combination to form an AM signal, and the subsequent demodulation process. The script also features visualizations of the signals in both time and frequency domains.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

//Sahil Vikas Takale

2. //22B-ET-055

3. //TE-ETC Engineering, Sem V 2024-2025

4. //Goa College Of Engineering

5.

6. fs=100 //sampling frequency

7. t=[0:1/fs:3] //time vector

8.

9. Vc=10 //amplitude of carrier signal

10. fc=40 //frequency of carrier signal

11.

12. l=length(t) //length of time vector

13.

14. figure(1)

15. xc=Vc*sin(2*pi*fc*t) //carrier signal expression

16. subplot(3,1,1)

17. plot(t,xc) //to plot the carrier signal

18. xgrid(4,1,7)

19. xlabel('t') //to label x axis

20. ylabel('Vc') //to label y axis

21. title('Carrier signal') //title of graph

22.

23. Vm1=8 //amplitude of first modulating signal

24. fm1=4 //frequency of first modulating signal

25. y1=Vm1*sin(2*pi*fm1*t) //1st modulating signal expression


26.

27. Vm2=7 //amplitude of second modulating signal

28. fm2=6 //frequency of second modulating signal

29. y2=Vm2*sin(2*pi*fm2*t) //2nd modulating signal expression

30.

31. y=y1+y2 //to add 1st and 2nd modulating signal

32. subplot(3,1,2)

33. plot(t,y) //to plot modulating signal

34. xgrid(4,1,7)

35. xlabel('t') //to label x axis

36. ylabel('Vm') //to label y axis

37. title('Modulating signal') //title of graph

38.

39. VAM=(Vc+y).*sin(2*pi*fc*t) //AM signal expression

40. subplot(3,1,3)

41. plot(t,VAM) //to plot the am signal

42. xgrid(4,1,7)

43. xlabel('t') //to label x axis

44. ylabel('V') //to label y axis

45. ylabel('VAM') //to label y axis

46. title('AM signal in time domain') //title of graph

47.

48. n=[-l/2:l/2-1]*fs/l //creating the frequency vector

49.

50. z1=abs(fftshift(fft(VAM))) //taking fft of am signal

51. figure(2)
52. subplot(3,1,1)

53. plot(n,z1) //plot n vs z1

54. xgrid(4,1,7)

55. xlabel('f') //to label x axis

56. ylabel('magnitude') //to label y axis

57. title('Modulated signal in frequency domain') //title of graph

58.

59. vm_det=VAM.*sin(2.*pi.*fc.*t) //Synchronous detection

60. vm_demod=abs(fft(vm_det)) //fft of demodulated signal

61.

62. lpf=[ones(1,5*fm2),zeros(1,l-5*fm2)] //creating lpf filter

63. b=fft(vm_det).*lpf //apply the filter to the fft of demodulated signal

64.

65. c=(ifft(b)) //compute iFFT to get time domain representation of demodulated signal

66.

67. subplot(3,1,2)

68. plot(t,c)

69. xlabel('t')

70. ylabel('vm-demod')

71. title('Demodulated signal')

You might also like