424 views

Uploaded by samoov

Tutorial for FTT in MATLAB with example

- 5096-25249-2-PB
- ch_2005
- lab9
- (Prentice-Hall Signal Processing Series) Steven M. Kay-Fundamentals of Statistical Signal Processing, Volume III_ Practical Algorithm Development-Prentice Hall (2013)
- FFT Matlab Tutorial
- final report xiaolu
- Dsp
- Cable Spacing as a Means of Noise Mitigation _ EEP
- Lecture 1.1 Signals and Systems
- Spring11-12_ClassRoutine_nov3
- Beam Form
- 239
- Fft
- A comparison of mel-frequency cepstral coefficient (MFCC) calculation techniques
- Mathematics - Fourier Transforms Using MATLAB
- CT nov.dec
- lec2
- BT-148 Manual.pdf
- ESE Mains_2019 Test Series Schedule_Final.cdr
- Analog and Digital Signals

You are on page 1of 3

There are many ways to define FFT in MATLAB in this tutorial is one of them:

the frequency domain so we want to use Fourier transform but in MATLAB there is FFT

(Fast Fourier Transform) which deals with sampled signals so the first step is to sample

our signal:

( ) which is and from shannon’s sampling theorem must be

greater than twice the highest frequency component of the signal.

resolution( ) represent minimum change in the signal to represent it in freq.

domain better and help us to define the frequency vector and represent a

large period of time so if we divide by we get the number of the samples in

this period of signal.

Third step is to define the frequency vector and time vector (why?)

We define the time vector to represent our signal in the time domain and the

frequency vector because we will draw the signal’s frequency components

In the freq domain.

%(why?) to make it equal in size with the frequency

% %vector (why? :D) we will know later why. We multiply

% %by TS to make time points at TS ,2TS,3TS…. (times of

sdsdsd %samples).

1

f=(1:N)*df; %begin the vector from 1 or 0 not important but make

%sure it the same size as time vector. We multiply by df as

%we multiply time vector by TS .This issue to be clear lets

%give example if FM=16Khz,df=FM/4=4khz,N=256,so if

%we don’t multiply by df vector frequency will be [1 2 3

% ….255] represent nothing of the freq. components of

%the signal. But if we multiply by df so frequency vector

%will be [1,2……..255]*4khz ,so the first point at 4khz

%the second point at 8khz etc….

Fourth step is to represent our Xt signal using time vector for example our signal

is sine wave with frequency FM.

Xt=sin(2*pi*FM*t);

The last step is to define FFT the function is fft(my signal)/no.of samples

We divide by N to be normalized fft.

Xf=fft(Xt)/N;

%not the same size as freq. vector we will not be able to

%draw Xf with the freq. vector because Xf is the same

%size as Xt as it’s came from it and Xt is the same size as

%the time vector and in stem we draw f(freq. vector)

%with Xf which they must be equal in size to be drawn in

%MATLAB so size(t)=size(f)=size(Xt)=size(Xf).

2

Example:

Code:

fm=3e3; fs=32*fm; ts=1/fs;

df=fm/64; to=1/df; n=to/ts;

t=(0:n-1)*ts;

f=(1:n)*df;

xt=sin(2*pi*fm*t);

figure(1);plot(t,xt);axis([0 0.6e-3 -1 1]);

xf=fft(xt)/n;

figure(2);stem(f,abs(xf));axis([0 6e3 0 0.7]);

Results:

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1

0 1 2 3 4 5 6

-4

x 10

0.6

0.5

0.4

0.3

0.2

0.1

0

0 1000 2000 3000 4000 5000 6000

- 5096-25249-2-PBUploaded byKamel Fedaoui
- ch_2005Uploaded byapi-3707694
- lab9Uploaded byDannyRao
- (Prentice-Hall Signal Processing Series) Steven M. Kay-Fundamentals of Statistical Signal Processing, Volume III_ Practical Algorithm Development-Prentice Hall (2013)Uploaded byibvc
- FFT Matlab TutorialUploaded byichwan13
- final report xiaoluUploaded byapi-242919535
- DspUploaded byPranjul Rastogi
- Cable Spacing as a Means of Noise Mitigation _ EEPUploaded bymahmoud fawzy
- Lecture 1.1 Signals and SystemsUploaded byAmir Mustakim
- Spring11-12_ClassRoutine_nov3Uploaded byrakib144
- Beam FormUploaded bymichaels247
- 239Uploaded byMemtode Jim Abigo
- FftUploaded byDaniel Araya Rocha
- A comparison of mel-frequency cepstral coefficient (MFCC) calculation techniquesUploaded byJournal of Computing
- Mathematics - Fourier Transforms Using MATLABUploaded byapi-3833675
- CT nov.decUploaded bykibrom atsbha
- lec2Uploaded bySharath
- BT-148 Manual.pdfUploaded byVíctor perales
- ESE Mains_2019 Test Series Schedule_Final.cdrUploaded bysewalya
- Analog and Digital SignalsUploaded bybayman
- [Self Test] Chapter 4 Fm (With Aswers)Uploaded byJayson Alva
- Dsp Matlab ProgramsUploaded bySomendra Sahu
- [J. Fernández de Cañete, C. Galindo, J. Barbanch(B-ok.cc)Uploaded byCamilo Ignacio Arriagada Jara
- COMP_V_BIT_MO10_NB.pdfUploaded bySanam1378
- Reach ProjectUploaded bykyungkang
- Electronic CircuitsUploaded byMasudRana
- Fourier_v1.0Uploaded byalexssc
- Digital Image Processing - Lecture Weeks 19 and 20Uploaded byJorma Kekalainen
- Imagerunner Advance c5051 SeriesUploaded byKaimook Copier
- Telecommunication QuestionsUploaded byBikash Chandra

- Allan NeilUploaded byJohn
- 223134365-Electrical-Electronics-Database.xlsxUploaded byUk
- Department of Labor: sraUploaded byDepartment of Labor
- A3953-Datasheet.pdfUploaded byfelres87
- PhD Research ProposalUploaded byshaheerdurrani
- Ericsson CommandsUploaded byAteeq Mustafa
- OPM Production ExecutionUploaded byJayaraman76
- Save space, increase efficiency, and boost performance in your remote office with Dell PowerEdge VRTXUploaded byPrincipled Technologies
- Homework Yang Ran RanUploaded byYang Ranran
- TI34P02K26-01E_002Uploaded byvalentinka_angel
- New Microsoft Word DocumentUploaded bynaveencbe1016
- 10.1.1.468.6937Uploaded byAlexandru Asmarandei
- Fire-Lite MRP2002E Data SheetUploaded byJMAC Supply
- wap54g_ugUploaded bykevinmarquez
- 1. HRR-HS 2580 Road BlockerUploaded byMuhammad Tahir Qamar
- SDE_manual_e.pdfUploaded bysunnguyen
- NBC_GuideUploaded bybrunocali
- Glossary of project management.pdfUploaded bySaid Ahmed Salem
- AM2117-basic surfaces.pdfUploaded byDragan Ionut
- BA LISTUploaded byHuyenthoai AOe
- CapstoneUploaded byhasan_tvu
- DigitalLineProtection GE DlpdUploaded byMarcWorld
- Oracle E-Business Daily Business Intelligence Implementation GuideUploaded byporus
- Cuba-ICT-MAUploaded bycubamark
- CPM & Pert - L.S. SrinathUploaded byArnav Dasaur
- Technical Note _ FAQ_ FortiGate and FortiOS Support for 802Uploaded bymstkaraca
- Optical Transport NetworkUploaded bynarayanbscribid
- Advertising DesignUploaded byLarine
- How to build a 3G/ 4G Solar RelayUploaded byMouti Maremma
- Acer Travelmate 4020 Laptop Service Guide Manual includes Machine Disassembly and ReplacementUploaded byYvette F. Harris