Search the Community

Showing results for tags 'fft'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 9 results

  1. lab!fyi

    Math on FFT traces

    Hi, I'm having some little trouble with WF. It's complex software so maybe missing something, but may be actual problems, two of them: 1) Wfm math in FFT window is acting little different than expected. I'm doing 0-50MHz sine sweep with ext gen on some filter and would like to see normalized response graph. For that I first create Ref 1 trace using Peak Hold Continuous. Then create filter response trace. Now try to get final plot using Math 1. No desired result since it calculates on current values, not the PHC plots! 2) Persistence window is not taking into account interpolation setting. It should be doing sin(x)/x but instead is doing linear. Also it would be helpful if interpolation setting is not deep in the menu but more easily accessible and perhaps could be individually steered for both Scope and Persistence window. Min/Max is also acting bit weird with low sample counts.
  2. Parggoo

    Frequency from Accelerometer

    Hello, I am getting successfully data from an accelerometer and I then I want to calculate the frequency of a vibrating object where the accelerometer is placed at. As you can observe in the attached VI after I obtain the accelerometer measurements I use data queue function in order to collect a certain amount of data(200), in order to have enough samples for my FFT. Then I use build waveform function and at the end filter and spectral measurements vi. But unfortunately I do not thing that I get the frequency I want.And that means not only that the x axis in waveform graph is not correct but in general when I vibrate the object in certain frequencies the spectrum does not show something close to them. Can anyone help me? Thank you
  3. Hi, I'm working on a WaveForms script which would be able to generate chart with the frequency profile of a liquid. For this, I need to use a Wavegen and a Scope: first I need to set the generator to a certain frequency and then I'd like to check the power of that signal on the scope. Between the probes of the generator and the scope there will be the liquid I would like to test. I created a basic script to step from 1 Hz to 150 Hz, check that signal with the scope, repeat this loop 5 times, and calculate the min, max and average values at each frequency. Although the script works, I have a few questions: * I couldn't find any documentation about the Scope.Channelx.fftmagnitude and fftfrequency arrays. Where should I look for them? Are there any other properties related to the FFT configuration? * Is there a way to set the number of BINs and samples of the scope's FFT? * Can I somehow use the Goertzel algorithm instead of FFT? (The Görtzel algorithm is designed to tell us the power of a signal at one predefined frequency. I would need this to get the power for the exact Hz value I define, and not the closest one I have from the FFT like I do it now. * Is there a way to change the color/style of the charts? Here is the script itself, but bear in mind that it is just the very first version const hzmax = 150; // the maximum frequency to measure const csamples = 5; // the number of samples to measure for each frequency const cdatapoints = 150; // chart X-axis resolution (currently: 1 datapoint / 1 Hz) var datapoints = new Array(4); // datapoint array datapoints[0] = new Array(cdatapoints); // max datapoints[1] = new Array(cdatapoints); // avg datapoints[2] = new Array(cdatapoints); // min datapoints[3] = new Array(cdatapoints * csamples); // raw data // clear the raw data array for(var j = 0; j < cdatapoints * csamples; j++) { datapoints[3][j] = 0; } // generate the freqeuncies to measure var frequencies = new Array(cdatapoints); for(var j = 0; j < cdatapoints; j++) { frequencies[j] = j+1; } { // configure plot plot1.X.Units.text = "Hz"; plot1.X.Offset.value = -hzmax/2 plot1.X.Range.value = hzmax; plot1.Y1.AutoScale.checked = false; plot1.Y2.AutoScale.checked = false; plot1.Y3.AutoScale.checked = false; plot1.Y4.AutoScale.checked = false; const vmax = 1.00; const vmin = 0.98; var offset = -(vmin + (vmax - vmin)/2); var range = (vmax - vmin); plot1.Y1.Offset.value = offset; plot1.Y2.Offset.value = offset; plot1.Y3.Offset.value = offset; plot1.Y4.Offset.value = offset; plot1.Y1.Range.value = range; plot1.Y2.Range.value = range; plot1.Y3.Range.value = range; plot1.Y4.Range.value = range; } { // configure wavegen Wavegen1.Channel1.Mode.text = "Simple"; Wavegen1.Channel1.Simple.Type.text = "Sine"; } { // configure scope Scope1.BufferSize.value = 1; Scope1.Buffer.value = 1; Scope1.Time.Mode.text = "Shift"; Scope1.Channel1.checked = true; Scope1.Channel2.checked = false; }; for (var n=0; n<csamples; n++) { Scope1.Time.Samples.value = 1024; for (var i=0; i<hzmax; i++) { // change the frequency to the next one var frequency = frequencies[i]; Wavegen1.Channel1.Simple.Frequency.text = frequency; Scope1.Time.Rate.value = frequency * 256; print("Frequency: ",frequency," Hz | Running @ ",Scope1.Time.Rate.value," Hz | ", Scope1.Time.Samples.value," samples"); // take a single sample Scope1.single(); Scope1.wait(); // check out the FFT values var rgmag = Scope1.Channel1.fftmagnitude; var rghz = Scope1.Channel1.fftfrequency; var c = rgmag.length; var minHzDistance = frequency; // check all the FFT values, and get the one closest to our inspected frequency for(var j = 0; j < c; j++) { var hz = rghz[j] var hzDistance = frequency - hz; if (hzDistance < 0) { hzDistance = -hzDistance; } if (hzDistance <= minHzDistance) { minHzDistance = hzDistance; datapoints[3][i*csamples + n] = rgmag[j]; } } // calculate the min, max, avg values var rgmin = 1000.0; var rgavg = 0.0; var rgmax = 0.0; var validsamples = 0; for(var j = 0; j < csamples; j++) { currentsample = datapoints[3][i*csamples + j]; if (currentsample != 0) { if (currentsample < rgmin) { rgmin = currentsample; } if (currentsample > rgmax) { rgmax = currentsample; } rgavg += currentsample; validsamples++; } } rgavg /= validsamples; print("Min:",rgmin," V | Avg:",rgavg," V | Max:",rgmax," V | error: +/-",minHzDistance," Hz"); print(); // save the calculated data into their arrays datapoints[0][i] = rgmax; datapoints[1][i] = rgavg; datapoints[2][i] = rgmin; // check if the error if too high if (minHzDistance > 0.5) { Scope1.Time.Samples.value *= 2; i--; } // plot the most recent values on the chart = datapoints[0]; // max = datapoints[1]; // avg = datapoints[2]; // min } }
  4. Hi, I am am able to compute the FFT using IP core block available in Vivado 2017. However, whatever is the sample rate of input signal to FFT IPcore, the frequency resolution of the FFT is fixed by clock frequency of the FFT. Example Frequency resolution = sampling frequency/number of samples DDS compiler generates sinusoidal frequency 976.56Hz at a clock freq of 1MHz,therefore the sample rate is 1Ms/s. this signal is given as input to the FFT IPcore 9.0 which is clocked at 5MHz with number of samples as 65536. therefore, Expected frequency resolution = 1MHz/65536, however, measured frequency resolution =5MHz/65536 in Behavioral simulation (Vivado 2017) It does not matter what is the clock frequency of DDS compiler, the frequency resolution of the FFT remains at 5MHz/65536. But, in reality the frequency resolution is fixed by sample rate of input signals and the buffer size of FFT. So, my question is, why in FPGA the frequency resolution is fixed by the clock frequency of FFT rather than sample rate of the input signal. Help is much appreciated. Regards, Subash
  5. subasheee

    Clarification for FFT implementation in FPGA

    Hi, I am trying to compute FFT of a synthesized square wave of frequency 100Hz. The 100Hz signal has to be sampled at 1kHz. So, I kept the clock frequency of FIFO, FFT_IPcore and other blocks at 1ms. I have attached the screenshot of the design file and simulation results. From the simulation output, it can be observed that the buffer stores for 512 samples and the un-buffer after 512*1ms. But, there is no output from the FFT block. I would like to know whether my approach is correct or I am committing any mistake in the way the blocks have to be integrated. Help much appreciated. Regards, Subash
  6. Weevil


    Hi all, i started to do a FFT from exact one sine wave with the XFFT(9.0). This works for the 32bit input signal, but for the 16bit input signal it seems not to work. By doing the FFT i would expect one peak in the frequency spectrum like i get in in the following picture: XFFT settings: - Architecture Choice -> Pipelined, Streaming I/O - Transform Lenght -> 256 - Scaling Options -> Scaled - Input Data Width -> 16 -> input signal from DDS 32bit - Input Data Width -> 8 -> input signal from DDS 16bit For generating a sine wave i use the DDS compiler at a Superious Free Dynamic Range of 96 dB and Frequency Resolution 100 Hz. The Phase Increment is in Streaming mode and set with a constant block to 4096. One sine wave is generated by 256 samples now (number_0 x2). If the settings are switched now for a 16bit sine input signal the FFT works not like i would expect. Maybe anyone has an idea? Thanky for any response!
  7. Hello, For a project in one of my courses my adviser asked me to find a way to control the sample rate and record length in the Analog Discovery in order to understand how to use the FFT module. Thank you, cjobi247
  8. Hello all, I am trying the measure a variable frequency signal, is it possible to create a custom scope channel that will display the most prominent frequency? If a scope channel is not possible, is there a way to continuously log the frequency over time? Currently, I am only able to get one frequency reading per acquisition using the logging tool and exporting the 'measurements' source.
  9. Hello everybody! Since I was sharing this image with others, I thought I'd share it here at Digilent as well. The attached image shows the frequency response of several FFT windows, including the well-known rectangle and Hanning windows. The blue window is one I've put together, but haven't shared the FPGA source code used to implement it. I challenge anyone to do better. Oh, and one other comment ... all but the Hanning window can be used in an invertible FFT process. Dan