+ All Categories
Home > Documents > Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project...

Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project...

Date post: 01-Oct-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
46
Due Date: 7 th Jan 2015 Date submitted: 7 th Jan 2015 Mohammed AL Nasser 201101137 Conor Sheedy Assessor: Date of Marking: Grade/Mark: Comments: Assessment Cover Sheet Course Title: Assessment Title: Programming Course No.: Student: Tutor: By submitting this assessment for marking, either electronically or as hard copy, I confirm the following: This assignment is my own work Any information used has been properly referenced. I understand that a copy of my work may be used for moderation. I have kept a copy of this assignment Telecommunication A Bachelor Engineering Technology ENB6060 Final project report
Transcript
Page 1: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Due Date: 7th Jan 2015 Date submitted: 7th Jan 2015

Mohammed AL Nasser 201101137

Conor Sheedy

Assessor: Date of Marking:

Grade/Mark:

Comments:

Assessment Cover Sheet

Course Title:

Assessment Title:

Programming Title:

Course No.:

Student:

Tutor:

By submitting this assessment for marking, either electronically or as hard copy, I confirm the following:

This assignment is my own work Any information used has been properly referenced. I understand that a copy of my work may be used for moderation. I have kept a copy of this assignment

Telecommunication A

Bachelor Engineering Technology

ENB6060

Final project report

Page 2: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Abstract:

The aim of this document presents and discusses in details the performed of a communication system simulated and constructed. Simulation section shows software which modulates and demodulates, AM and FM signals. Construction section demonstrates the results of a designed AM circuit. This paper provides a comparison between the results obtained from simulated and constructed AM modulation and demodulation.

Introduction:

In this technical paper, differences, advantages and disadvantages of AM and FM signal will be explained. The results obtained from the simulated and constructed of the designed communication system will be demonstrated. All methods used during simulation, construction and measurement will be included and explained in this report. The results obtained from both simulated and constructed will compared and discussed. This report will contain some measurements and graphs of the performed work. A conclusion will be included to summarize all work performed in simulation and construction sections.

2

Page 3: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

ContentsAbstract:.........................................................................................................................................2

Introduction:...................................................................................................................................2

Differences between AM and FM:..............................................................................................5

Advantages and disadvantages of AM and FM:..........................................................................6

Simulation section:.........................................................................................................................7

Explanation of the code:.........................................................................................................7

Result of simulation:...................................................................................................................8

Conclusion of simulation section:.............................................................................................21

Construction section:....................................................................................................................22

Apparatus:................................................................................................................................22

Results and measurements:......................................................................................................23

Comparison between constructed and simulated AM:................................................................28

Conclusion:...................................................................................................................................30

References:...................................................................................................................................31

Appendix:.....................................................................................................................................32

Appendix A:..............................................................................................................................32

Appendix B:...............................................................................................................................36

3

Page 4: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Table of figures

Figure 1: Differences between FM and AM....................................................................................5Figure 2: baseband signal...............................................................................................................8Figure 3: baseband signal after modifying time axis.......................................................................9Figure 4: FFT of the baseband signal.............................................................................................10Figure 5: carrier waveform...........................................................................................................11Figure 6: FFT of the carrier signal..................................................................................................12Figure 7: AM modulated signal through the channel...................................................................13Figure 8: FFT of the modulated signal...........................................................................................14Figure 9: AM modulated signal after full wave bridge rectifier.....................................................15Figure 10: Demodulated signal.....................................................................................................16Figure 11: FFT of the demodulated signal.....................................................................................17Figure 12: FM modulation through channel.................................................................................18Figure 13: FFT of FM modulation..................................................................................................19Figure 14: FM demodulated signal...............................................................................................20Figure 15: FFT of FM demodulated signal.....................................................................................21Figure 16: Massage signal from arbitrary.....................................................................................23Figure 17: carrier signal from FGEN..............................................................................................24Figure 18: Modulated signal.........................................................................................................25Figure 19: DSA of the AM signal...................................................................................................26Figure 20: AM demodulation........................................................................................................27Figure 21: Designed circuit...........................................................................................................36

Table of tables

Table 1: Difference between AM and FM.......................................................................................5Table 2: AM advantages and disafvantages....................................................................................6Table 3: FM advantages and disadvantages...................................................................................6

4

Page 5: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Differences between AM and FM:

Table 1: Difference between AM and FM.

Amplitude modulation: Is the encoding of information (data) by varying the amplitude of carrier wave signal

while the frequency of the modulated signal is fixed.

Frequency modulation: Is the transmitting of data by waving the instantaneous frequency of the modulated

signal while the amplitude is fixed. In another word, frequency modulation (FM) is a way to

present data (voices and sounds) as an AC signal. The amplitude of the signal is fixed, but the frequency of the signal is varying, Poole, I.

(n.d.). Frequency Modulation Advantages & Disadvantages.

The first signal presents the massage (baseband) signal (has low frequency). The second signal presents the carrier signal- which will carry the massage signal to modulate it. The third signal

presents AM modulation of the massage signal- as it shown, the amplitude changes according to the baseband frequency. The last signal presents FM modulation of the baseband signal- as it shown, the frequency of the signal varies with changing in frequency of the baseband signal

while the amplitude remain the same.

5

Figure 1: Differences between FM and AM.

Page 6: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Advantages and disadvantages of AM and FM:

AM advantages and disadvantages:

Table 2: AM advantages and disafvantages.

Advantages of AM signal It is very simple to implement. It can be demodulated using a circuit

containing of very few components. AM receivers are very cheap as no

particular (complicated) components are involved.

disadvantages of AM signal An amplitude modulation signal is not efficient in terms of its power usage.

It is not efficient in terms of its use of bandwidth, requiring a bandwidth equal to twice that of the highest

audio frequency. An amplitude modulation signal is

affected with high levels of noise because most noises affect amplitude.

FM advantages and disadvantages:

Table 3: FM advantages and disadvantages.

Advantages of FM signal The FM signals have small amount of distortion, Higher frequencies can carry more data than the low frequency signals. The received signals are clearer than AM signals. The signals resilient to noise. Does not require linear amplifiers in the

transmitter. Enables greater efficiency than many other modes (Advantages of FM over AM?, 2012).

disadvantages of FM signal If the signal frequency is too high and the transmitting distance is small, the receiver won't be able to receive the signal. The range of the signal is limited by line of sight. Need an Amplitude limiter

circuit. FM signals require more complicated demodulator circuits. The sidebands extends to infinity, Which mean it needs filters which will

cause some distortion in the signal (Advantages ofFM over AM?, 2012).

6

Page 7: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Simulation section:

This section contains an explanation of the software used to modulate and demodulate AM and FM signal. A discussion of this method is included. Besides; the results of this method will be presented with a description in both time and frequency domain.

Explanation of the code:The software MATLAB code explains how the signal was modulated and demodulated using AM and FM methods, software included in Appendix A.

Time domain:

The time of the data used (baseband) was modified to show the real time of the sound (in seconds), see time section in the code.

The time was fixed by dividing the array size over the sampling frequency of the baseband.

Frequency domain:

X axis: dividing the sampling frequency by the length of the array to calculate the step in the frequency domain. The axis was set from 0 to (sampling frequency – steps).

Carrier:

In the carrier section, the carrier frequency was set to be 20 KHz, and sine wave rule was used to obtain the carrier signal.

carrier=Asin (2∗pi∗f∗t)

AM modulation section:

A multiplication of the baseband and carrier (plus carrier signal) was done to produce double sideband full carrier signal.

AM=(baseband signal+carrier signal )+carrier signal

A channel (noise) was added to the Am modulated signal to produce more realistic signal.

AM throughchannel=AM+no ise

In the Am demodulation:

The absolute values of the modulated signal were used to act like an ideal full wave bridge rectifier.

7

Page 8: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Low pass butter worth filter was used to remove high frequencies from the rectified signal, to produce the baseband signal.

FM modulation:

The signal was integrated and used in the FM modulation equation to produce FM modulation signal. A noise was to the signal to create a realistic modulation.

BW=2∗( frequency deviation+ frequency of the signal)

FM demodulation:

A function was used to demodulate the signal and obtain the original signal. This method was used because it was hard to implement phase locked loop method as a MATLAB code.

Result of simulation:

This figure displays the original massage signal with a 16 bits, the sampling frequency of the signal (383 KHz)

8

Figure 2: baseband signal.

Page 9: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This figure shows the baseband signal, the time of the signal was modified to be 2 seconds as the length of the original wave sound.

9

Figure 3: baseband signal after modifying time axis.

Page 10: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This FFT figure displays the baseband signal in frequency domain. The plot shows the frequency of the baseband (3 KHz) and the mirror side of the signal. The copied signal will be ignored to measure the bandwidth of the signal.

10

Figure 4: FFT of the baseband signal.

Page 11: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This figure displays the carrier signal that was used to carry the baseband signal to AM modulation. The frequency of the carrier signal 20 KHz. A sine rule was used to produce this carrier signal.

Carrie r signal=A∗sin (2∗π∗carrier frequency∗time)

The time of the signal is 2 seconds, as is it was with baseband signal.

11

Figure 5: carrier waveform.

Page 12: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This FFT plot presents the carrier signal in frequency domain. The frequency of the carrier is shown in the plot as it was set in the software code (20 KHz). The copied signal of the carrier will be ignored while measuring the bandwidth of the signal.

12

Figure 6: FFT of the carrier signal.

Page 13: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This figure shows the AM signal through a channel. The channel of signal was implemented in Matlab by adding a noise to the modulated signal to make more real application of AM communication system.

The figure above presents the AM modulation signal.

This produced AM modulated signal is a double side full carrier signal.

AM=(Baseband signal∗Carrier signal )+Carrier signal

The above equation was used to produce the modulated signal.

13

Figure 7: AM modulated signal through the channel.

Page 14: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

The plot demonstrates the modulated signal. As it shown, the carrier frequency is (20 KHz) and small jumps beside the carrier signal presents the lower and upper sidebands.

upper sideband=carrier signal+baseband signal

upper sideband=20,000+3,000=23kHz

lower sideband=carrier signal−baseband signal

lower sideband=20,000−3,000=17 kHz

14

Figure 8: FFT of the modulated signal.

Page 15: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

At this step the modulated signal will be demodulated by using full wave rectifier and an envelope detector.

The above figure shows the multiplication of the carrier and baseband signals after removing the negative values by plotting the absolute values of the signal – to make it act as a full wave bridge rectifier.

15

Figure 9: AM modulated signal after full wave bridge rectifier.

Page 16: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This plot presents the demodulated signal. Some of the carrier signal could not be removed by the low pass butter worth filter. To perform a batter demodulated signal an envelope detector should be used instead of using low pass filter; however, it was difficult to implement the theory behind the envelope detector as a Matlab code.

16

Figure 10: Demodulated signal.

Page 17: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This FFT plot shows the frequency of the demodulated signal (baseband signal), which is (3 kHz). The copied signal will be ignored to measure the bandwidth of the signal.

17

Figure 11: FFT of the demodulated signal.

Page 18: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This figure shows the FM modulated signal (blue signal) of the audio (baseband) used. The figure does not show clearly the narrow and wide bands of the signal due to the small time and fast modulation. The modulation was done by integration the baseband and substitute in the FM modulation equation. The green signal presents the channel (noise) that the signal flows through.

18

Figure 12: FM modulation through channel.

Page 19: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This FFT plot presents FM modulation signal in frequency domain through FM channel. As it shown, the middle high amplitude component presents the carrier signal (20 kHz), and the rest components represent the infinite sideband of the modulation method. According to Carson’s rule, 98% of power of the signals is consumed in first two components of the signal.

Carson’s rule:

BW=2∗( frequency deviation+ frequency of the signal)

19

Figure 13: FFT of FM modulation.

Page 20: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This plot represents the FM demodulated signal (original/baseband signal). As it shown, there are some small noises at the beginning and at the end of the signal. These noises occurred due to that the signal went through the FM channel designed in MATLAB.

The amplitude of the demodulated signal is same as the original signal (0.5v).

20

Figure 14: FM demodulated signal.

Page 21: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

This FFT plot displays the FM demodulated signal in frequency domain. As it shown, the frequency of the signal is 3 kHz (same as the original). The amplitude of the signal is higher than the original due to that the filter in demodulation function did not filtered all the carrier signal- that is why there is some noise at the beginning and at the end of the signal when it is played. The copied (mirror) components were removed from the graph. Only the original signal will be used to measure the bandwidth of the signal.

Conclusion of simulation section:This part of the project covered the simulation section of the modulation and demodulation of AM and FM using Matlab. The results showed the signals in time and frequency domains. An explanation was provide on each graph and plot obtained. Theory behind AM and FM was fully understood through the simulation section.

21

Figure 15: FFT of FM demodulated signal.

Page 22: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Construction section:

In this section, an AM modulation and demodulation system will be constructed and designed based on the theory covered through the simulation section. The results of the construction will be recorded, provided and discussed. A comparison between the results obtained from construction and simulation section of AM modulation and demodulation will be included.

Double sideband full carrier method was implemented to construct AM communication system. This method was chosen because it is simple and easy method to perform.

Apparatus:

Arbitrary waveform generator: (to generate the same audio used in the simulation section).

FGEN: to generate a carrier waveform. Multiplier: AD633JNZ Multiplier chip – multiply carrier by baseband signal. AM

modulation. Capacitors: 100 nF – decoupling capacitors in the multiplier. Detector: 10 k ohm and 100 nF. 1N4148 diode: half wave rectifier. AUX jack (female): used to connect headphones to the circuit. Headphones: act like an envelope detector – contain an inductor inside it, which will

detect the baseband signal and provided to be able to be heard (demodulator). Single breadboard: used to build the circuit on it.

22

Page 23: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Results and measurements:

Baseband signal:

Figure 16: Massage signal from arbitrary.

Same audio wave that used in the simulation section was generated from the arbitrary to produce a massage signal for the construction section. The update rate was set to 50k S/s to make the time of the signal as the original (2 seconds). The sampling frequency of the signal 100k Hz. The gain of the signal was set to 1 vp-p as the original.

23

Page 24: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Carrier signal:

The figure shows the carrier signal produced using FGEN from the ELVIS board. The frequency of the signal is 200 kHz.

24

Figure 17: carrier signal from FGEN.

Page 25: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

AM modulation:

The scope in the EVILS was used to display the modulated signal after multiplying the baseband signal by the carrier (plus the carrier signal) using the multiplier chip provided.

Equation of multiplication inside the chip:

W= ( x 1+ x2 )∗( y1+ y 2 )10

+Z

Where:

X = the baseband signal.

Y = the carrier signal.

Z = optional input (used for double sideband full carrier).

25

Figure 18: Modulated signal.

Page 26: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

AM modulation in frequency domain:

This DSA graph demonstrates the AM signal in frequency domain. The frequency of the carrier can be detected from the spectrum (200 kHz). The upper and lower sidebands are presented clearly:

upper sideband=carrier signal+baseband signal

upper sideband=200,000+3,000=203 kHz

lower sideband=carrier signal−baseband signal

lower sideband=200,000−3,000=197 kHz

26

Figure 19: DSA of the AM signal.

Upper

Sideband

Page 27: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

AM demodulation:

This graph shows the output of the designed AM modulation and demodulation circuit. In the graph, the demodulated signal is presented (original signal). The half wave bridge rectifier was used to remove the negative side of the modulated signal and by using the envelope detector the baseband was separated from the carrier signal. The amplitude of the baseband has been changed from the original signal due to the multiplier IC used – the IC divide the multiplication of the carrier and baseband by 10, due to that problem in the multiplier used the volume of the demodulated will be less power than the original. Besides; there will be a drop in voltage occurred due to the diode (0.7v)

27

Figure 20: AM demodulation.

Page 28: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Comparison between constructed and simulated AM:

AM modulation:

28

Page 29: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

29

Page 30: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

The graph above shows the differences between the AM modulations in the constructed and simulated. In the constructed method, the modulation index of the can be presented and measured easier. In the simulated method, the carrier and sampling frequency of the baseband were much lower than the one used in the constructed part.

AM demodulation:

30

Page 31: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

In this demodulation comparison, the constructed demodulated signal shows more reliable and better than the simulated method. The constructed signal shows the original signal with less amplitude (due to the multiplier chip used – divides the amplitude by 10). The simulated signal presents the original signal with same amplitude; however, too much noise could not be removed when using butter worth low pass filter.

Differences between low pass filter and envelope detector:

The function of the low pass filter is to block high frequencies from passing – it may remove some of the baseband signal while trying to remove all noises.

In other hand, envelope detector, detects the required signal (baseband signal) and separate it from the carrier signal. This method do not effect on the message signal.

Conclusion:

To conclude, this report covered the theory of the AM and FM modulation and demodulation in the simulated section through the written MATLAB code. The results obtained were explained and discussed in details. The theoretical equations agree with experimented and simulation performance with slight errors. The constructed and comparison sections showed a full understanding of the AM modulation and demodulation.

31

Page 32: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

References:

http://www.egr.msu.edu/em/research/goali/notes/module7_am_fm.pdf http://en.wikipedia.org/wiki/Modulation

32

Page 33: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Appendix:

Appendix A:clear all;close allclc%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Name: Mohammed AL Nasser %% %%ID number: 201101137 %% %%this software is used to modulate and demodulate AM and FM signals. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Message:[data,FS,NBITS]=wavread('16bitNSF.wav'); %locate the filesound (data,FS); %play the original sound.plot (data);xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the Message before setting the time');grid; %time:[r,c]=size(data); %to show the number of columns and rows.time = r/FS; %to calculate the time, divide the number of points over the sampling rate.timer = linspace (0,time,r); %time.figure;plot(timer,data);grid;xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the Message signal'); %FFT for message.s = FS/r; %sampling frequency divided by the length of array. sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.ydata = abs(fft(data)); %the y axis for the FFT. using abs to remove j.figure;plot(f,ydata); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');title ('FFT of Message'); %carrier:fc = 20000; %carrier frequency Hz.carrier = 1*sin(2*pi*fc*timer); %produce carrier signal.figure;plot(timer,carrier);

33

Page 34: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the carrier signal'); %FFT for carrier.s = FS/r; %sampling frequency divided by the length of array. sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.ycarrier = abs(fft(carrier)); %the y axis for the FFT. using abs to remove j.figure;plot(f,ycarrier); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');title ('FFT of carrier'); %Am modulated:AM = (data'.*carrier)+carrier; %produce the AM signal.AMchannel = awgn(AM,15 ,'measured'); %channel 1.figure;plot (timer,AM,timer,AMchannel);xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the AM modulated signal with a noise from the channel');grid;%pause;%sound (AM,FS); %play AM modulate sound. %FFT for AM modulated.s = FS/r; %sampling frequency divided by the length of array. sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yAM = abs(fft(AM)); %the y axis for the FFT. using abs to remove j.figure;plot(f,yAM); grid;xlabel ('Frequency Hz');ylabel ('Amplitude');title ('FFT of AM modulation'); %FFT for AM modulated with noise.s = FS/r; %sampling frequency divided by the length of array. sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yAMchannel = abs(fft(AMchannel)); %the y axis for the FFT. using abs to remove j.figure;plot(f,yAMchannel); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');title ('FFT of AM modulation with noise'); %Am demodulate:figure;plot (timer,abs(AMchannel)); %plotting the absolute value of the AM signal.xlabel('Time (s)');

34

Page 35: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

ylabel ('Amplitude');title ('plot of the AM signal after the bridge rectifier');%Filter:[b,a] = butter(3,0.2); %butterworth filter (order of the filter, Omega.F = filter(b,a,abs(AMchannel)); %function of the filter.figure;pause;sound (F,FS); %play sound of the AM demodulated signal.plot(timer,F);xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the AM Demodulated signal'); %FFT for AM demodulated.s = FS/r; %sampling frequency divided by the length of array. Sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yF = abs(fft(F)); %the y axis for the FFT. using abs to remove j.figure;plot(f,yF); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');title ('FFT of AM demodulation'); %FMinteg = cumsum(data')/FS; %integration of the signal.freqdev =1000;Y = sin(2*pi*fc*timer + 2*pi*freqdev*integ); FMchannel = awgn(Y,fc ,'measured'); %channel for the FM.figure;plot (timer,Y,timer,FMchannel);grid on;xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the FM modulated signal with noise from the channel'); %FFT for FM modulated.s = FS/r; %sampling frequency divided by the length of array. Sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yY = abs(fft(Y)); %the y axis for the FFT. using abs to remove j.figure;stem(f,yY); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');title ('FFT of FM modulation'); %FFT for FM modulated with noise.s = FS/r; %sampling frequency divided by the length of array. Sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yFMchannel = abs(fft(FMchannel)); %the y axis for the FFT. using abs to remove j.figure;stem(f,yFMchannel); grid;xlabel ('Frequenc Hz');ylabel ('Amplitude');

35

Page 36: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

title ('FFT of FM modulation with noise'); %FM demodulaed:Z = fmdemod(FMchannel,fc,FS,900); %function to demodulate.figure;plot(timer,Z);grid on;xlabel('Time (s)');ylabel ('Amplitude');title ('plot of the FM demodulated signal');pause;sound (Z,FS); %sound of the FM demodulated. %FFT for FM demodulated.s = FS/r; %sampling frequency divided by the length of array. sampling inside FFT.f = 0:s:FS-s; %the frequency axis of the FFT.yZ = abs(fft(Z)); %the y axis for the FFT. using abs to remove j numbers (imaginary numbers) .figure;plot(f,yZ); grid;xlabel ('Frequency Hz');ylabel ('Amplitude');title ('FFT of FM demodulation');

36

Page 37: Abstract: - mohammedalnasser.weebly.com  · Web viewAssessment Cover SheetFinal project reportAssessment Title: Bachelor Engineering Technology Programming Title: . Course No.: ENB6060.

Appendix B:

Figure 21 presents the design communication system (AM modulation and demodulation).The circuit was tested by plugin headphones (male) in the audio jack (female) and hears the inputted sound.

The multiplier must be supplied with +15v and -15v. Decoupling capacitor must be connected also.

The envelope detector value (10 k Ohm – 100 nF).

The detector should be removed if the audio jack is connected to the output of the circuit – because the headphones act like a detector, so the detector will be useless in this case.

The headphones contain a inductor and a capacitor, so the modulated signal will be automatically demodulated.

37

Audio Jack

Half wave rectifier

Multiplier

Figure 21: Designed circuit.

Envelope detector


Recommended