However, we can choose a reasonable length if we know about the nature of the signal.įor example, the cosine signal of our interest is periodic in nature and is of length samples (for 2 seconds duration signal). The length of the transformation should cover the signal of interest otherwise we will some loose valuable information in the conversion process to frequency domain. The FFT function computes -point complex DFT. Lets represent the signal in frequency domain using the FFT function. Represent the signal in frequency domain using FFT X=A*cos(2*pi*fc*t+phi) %time domain signal with phase shift Phi = phase*pi/180 %convert phase shift in degrees in radians Phase=30 %desired phase shift of the cosine in degreesįs=32*fc %sampling frequency with oversampling factor 32 I have chosen a oversampling factor of so that the sampling frequency will be, and that gives samples in a seconds duration of the waveform record. In order to represent the continuous time signal in computer memory, we need to sample the signal at sufficiently high rate (according to Nyquist sampling theorem). Discrete-time domain representationĬonsider a cosine signal of amplitude, frequency and phase radians (or ) Wireless Communication Systems in Matlab, ISBN: 978-1720114352 available in ebook (PDF) format (click here) and Paperback (hardcopy) format (click here). This article is part of the book Digital Modulations using Matlab : Build Simulation Models from Scratch, ISBN: 978-1521493885 available in ebook (PDF) format (click here) and Paperback (hardcopy) format (click here) Reconstruct the time domain signal from the frequency domain samples.Extract amplitude and phase information from the FFT result.Represent the signal in frequency domain using FFT ( ).Represent the signal in computer (discrete-time) and plot the signal (time domain).Outlineįor the discussion here, lets take an arbitrary cosine function of the form and proceed step by step as follows
In this post, I intend to show you how to obtain magnitude and phase information from the FFT results. In the previous post, Interpretation of frequency bins, frequency axis arrangement (fftshift/ifftshift) for complex DFT were discussed.