We will show FFT example where the analog signal is generated on analog output and acquired with DSP management functions. MicroDAQ toolbox provides macros for managing DSP execution, a user can load DSP binary from Scilab script, register signal, read data from running DSP application and terminate its execution. This way application can be divided into a real-time part, which is executed on MicroDAQ DSP and script which allows using all Scilab functions for calculations. The FFT example uses Xcos generated DSP application and Scilab FFT function which calculates FFT from real-time data. Our application will calculate FFT from real-time DSP data., we will start from creating example model which generates analog signal with two sine waveforms with different amplitude and frequency. The diagram contains two sine waveform generators which output is added and passed to DAC block. Then we use ADC block to read analog samples from DAC (analog input and output should be wired). Data from ADC block is passed to SIGNAL block which sends data to host and this data can be read from Scilab script. Our model will run with 5kHz.Īfter model creation, we generate DSP application by selecting Tools->MicroDAQ build model. Running DSP application from Scilab script The resulting application will be used in Scilab script for FFT calculation. S=sin(2*%pi*50*t)+ 0.3*sin(2*%pi*70*t+%pi/4)+ 0.MicroDAQ toolbox for Scilab provides macros which manage DSP execution. build a noides signal sampled at 1000hz containing to pure frequencies This also displays frequency in Hz, not radians. It demonstrates a normalized plot showing only the positive X-axis, and if you play with the input signal amplitudes, it will be reflected 1 for 1 on the frequency plot. Here is a bit that I modified from one of the help manual examples. This could be normalized by dividing by N/2. So on to your question, "what does the y axis mean?" It's 50, and we would expect it to be "1". The output of the FFT plot represents the frequency(s) present in the signal analyzed on the X axis, and the magnitude (amplitude) of the additive component at that frequency. Fourier has demonstrated that any mathematical function can be represented as a sum of sines of different frequencies and time relationship (phase). FFT (or fast fourier transform) merely refers to a computational algorithm to compute the DFT (Discrete Fourier Transform) of a digitally represented signal. This relates to the whole chunk of theory behind the Fourier transform. Short answer: The Y axis is signal amplitude * N/2. Now, click on the image and look where the peaks are. Observing that w = 0.5 is the frequency of the sampled signal, the true frequency (of the analog source signal) is given by w_source = w/T = 0.5/0.1 = 5 rad/s. Plot(f*2*%pi*T, X) // plot the signal indexed by radians Plot(n*T, x) // plot the signal indexed by seconds W = 0.5 // frequency of the sampled signal (in radians) The function fft(.) returns the signal in the interval, so you can use the function fftshift(.), over the function fft(.) like this: X = fftshift(fft(x)), that it returns the Fourier Transform in the intervals:Ībout the frequencies, if your signal was sampled with a rate T (T samples by second), the indexes are given multiplying the interval by: 2*%pi*T. If your signal has N values, then the Fourier Transform has N distinct values. This post is about the FFT function, and anyone wants to know how to specify the frequencies for plot the values. I'd like to know my readers, but the "no name" readers deserve respect, as everybody.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |