Why does the frequency component correspond to 3 on the horizontal axis? Well, if you look back at the time-domain plot, the array that was passed to the fft() command has two full sine-wave cycles. Plot(BasebandDFT_magnitude(1:(BufferLength/2)))Īll we’ve done here is tell the plot() command to display only the first half of the data. We can eliminate this distraction as follows: This occurs because the DFT calculations generate symmetric results-i.e., the right half of the plot is a mirror image of the left half of the plot.
The first issue is that a single-frequency sine wave has resulted in two DFT frequency components. I would not describe this plot as particularly helpful, but it’s a good start. The following commands will generate a frequency-domain representation of this waveform:īasebandDFT_magnitude = abs(BasebandDFT) Let’s start by creating the baseband signal and then looking at the time-domain and frequency-domain plots.īasebandSignal = sin(2*%pi*n / (SamplingFrequency/BasebandFrequency)) (I chose this carrier frequency for the sake of convenience in a typical RF application it would be much higher.) The sampling frequency will be 1 MHz. In this article we will be working with a 10 kHz baseband signal and a 100 kHz carrier.
The Discrete Fourier Transform of a Sine Wave
This series of numbers says nothing about corresponding real-world frequencies, and consequently we have to provide that information elsewhere in order to generate a more informative spectrum. When we have a command such as fft(BasebandSignal), the input array is just a series of numbers. Often we are interested only in the magnitude (or the word “amplitude” might be more intuitive here) of the signal’s frequency components, and we can extract this magnitude data using the abs() command.Īnother issue is the lack of actual frequencies we discussed this same complication, though with regard to time-domain sampled signals, in the previous article. The first reason for this is the fact that the results of the DFT computation are complex numbers that convey both magnitude information and phase information. However, a command such as fft(BasebandSignal) will not produce data that can be displayed as a typical frequency-domain plot. We can generate DFT data for a waveform by including the corresponding array as an argument in an fft() command. My guess is that some people who have often heard the term “FFT” are not familiar with the term “DFT.” The FFT (fast Fourier transform) is simply a name used to refer to algorithms that can efficiently perform DFT calculations you can learn more about the FFT here. If we want to generate this same type of information in the context of sampled signals, we can use the discrete Fourier transform, abbreviated DFT. The original Fourier transform is a mathematical procedure that takes an expression that is a function of time and produces an expression that is a function of frequency. The Fourier transform provides a way of identifying the frequency content of a signal. A frequency-domain representation of a single-frequency sinusoid isn’t very interesting, though, and in the next article we’ll look at frequency-domain analysis in the context of RF modulation. The primary goal in this article is to understand and gain experience with Scilab’s fft() command, which allows us to display waveforms in the frequency domain.
In a previous article, I introduced Scilab and the concept of digital sinusoid generation, and we used the plot() command to display time-domain waveforms. The Many Types of Radio Frequency Modulation.Learning to Live in the Frequency Domain.In this article we’ll work with sinusoidal signals in the frequency domain using Scilab’s fast Fourier transform (FFT) functionality.