Advanced MATLAB (for Electrical Engineers) Day 2 - PowerPoint PPT Presentation

About This Presentation
Title:

Advanced MATLAB (for Electrical Engineers) Day 2

Description:

Advanced MATLAB (for Electrical Engineers) Day 2. Instructor: Kamran Arshad. EE Club, KFUPM ... Simulation of a simple binary data transmission scheme (Digital ... – PowerPoint PPT presentation

Number of Views:578
Avg rating:3.0/5.0
Slides: 13
Provided by: davidabade
Category:

less

Transcript and Presenter's Notes

Title: Advanced MATLAB (for Electrical Engineers) Day 2


1
Advanced MATLAB(for Electrical Engineers)Day 2
  • Instructor Kamran Arshad
  • EE Club, KFUPM
  • 28 March 2004
  • KFUPM

2
Line of Action
  • Today course follows as
  • General Communication Concepts
  • Fourier Transform of signals
  • Finding autocorrelation and PSD of signals
  • Generation of Gaussian random variables
  • Amplitude Modulation
  • Frequency Modulation
  • Simulation of a simple binary data transmission
    scheme (Digital communication)

3
Why we study these topics only ?
  • Fourier analysis is important ----we are
    interested in spectrum of signals.
  • Gaussian random variables --- we model noise
    normally as WGN.
  • In statistical analysis, autocorrelation and PSD
    are most important parameters.
  • AM and FM are most popular analog transmission
    techniques

4
Fourier Transform
  • Extension of Fourier series for non periodic
    signals
  • Fourier transform of a time domain signal x(t) is
    given by
  • In MATLAB we use function fft and fftshift.
  • Type on your command prompt help fft and help
    fftshift

5
Problem !!!
  • Calculate and plot the spectrum of an audio
    signal.
  • Plot signal in time domain as well as signal in
    frequency domain (spectrum) in one figure window.
  • Use MATLAB functions fft, fftshift, subplot and
    plot.

6
MATLAB Code
  • clc To clear Screen
  • clear Clear all previousy stored
    variables
  • close all Close all open windows
  • Load data file (audio file)
  • This command load variables fs, t and signal m
  • load Audio_Signal.mat
  • Plot the signal in time domain
  • subplot(211),plot(t,m)
  • title('Audio Signal in time domain')
  • xlabel('Time (seconds)')
  • Calculating the Fourier Transform of signal
  • Mfftshift(fft(m))
  • Magnitude Spectrum
  • Mabs(M)
  • MM/max(M)

7
Spectrum of Audio Signal
8
Gaussian Random Variables
  • Random processes are an integral part of any
    communication system.
  • Often used in practice to simulate effect of
    noise or noiselike signals.
  • MATLAB library have several random number
    generators like rand and randn
  • See help of these two functions
  • There are many methods of generating random
    variables, I choose one of them.

9
On command window .
  • On your command prompt type the following lines
  • var1
  • var2
  • for i110000
  • var1(i),var2(i)g_rand_generator
  • end
  • subplot(121),hist(var1,1000)
  • subplot(122),hist(var2,1000)

10
MATLAB Code
  • function GRV1,GRV2 g_rand_generator(m,sgma)
  • r_rand_generator generates tow independant
    gaussian random variables
  • of mean m and variance sgma. By default value
    of m is 0 and sgma is 1.
  • If no input argument is given assume these
    values
  • if nargin 0
  • m0 sgma 1
  • end
  • Generate a uniform random variable in the range
    0 and 1
  • u rand
  • Generate a Rayleigh distributed random variable
  • z sgma(sqrt(2log(1/(1-u))))
  • Another uniform random variable in the range 0
    and 1
  • u rand
  • Gaussian Random Variables

11
Distribution of Gaussian Random Variables
12
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com