From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

SMT Zoom FFT Example

To try and understand how to use the ZoomFFT functions in the Spectral Measurements package, I built the SmtContinuousZoom C# example from NI-SMT 2.6.3. Using the default values for the example (see attached screenshot), it computes a spectrum size of 26214400, a FFT size of 52297728 and a maximum block size of 798. With these settings, it takes a very very long time to process the data and ends up with what appears to be all 0's for the spectrum output from the ContZoomFFTEx() function.

 

My questions are: 1) the spectrum size and FFT size seem inordinately large (in the Config() function, the example code requests 400 spectral lines, for instance, yet the function returns 26214400 as the optimal value); 2) if those inputs to the FFT function are correct, why is the spectral response all 0's (the input data is a simulated sine wave of 798 points at 1000 Hz)? 

0 Kudos
Message 1 of 12
(4,037 Views)

Hi Brandle,

 

I only have the LabVIEW support for SMT 16.0 installed on my computer and the examples look a little different. Using the default settings on my end, the examples I’ve run seem to be working as expected with the default settings.

 

Did you change anything else in the code? With the simulated data examples I’ve been running, there are default signal settings for the simulated signal as well as well.

 

I’ll see if I can get access to VS so I can take a look at the same example. In the meantime, can you post the code here as well?

0 Kudos
Message 2 of 12
(3,984 Views)

I've attached the code here. I had made some changes, but backed them out to see if it was my code or not. What I've attached is direct from the niSMT_DotNETWrapper_2.6.3.zip download.

 

Download All
0 Kudos
Message 3 of 12
(3,981 Views)

Looking at this code, this seems more like a single function than a full example. Where is this located on disk?

 

All of the examples for SMT should be in the following location:

 

C:\Users\Public\Documents\National Instruments\Spectral Measurements Toolkit\Examples

0 Kudos
Message 4 of 12
(3,969 Views)

Yes, there is an example folder in the location you mention. However, the only item in there is a shortcut to C:\Users\Public\Documents\National Instruments\CVI\samples\smt - which contains several CVI examples.

 

The DotNET versions are in a separate downloadable zip file, which is niSMT_DotNETWrapper_2.6.3.zip. Inside that zip file are two examples for DotNET: "Smt  Adjacent Channel Power" and "SmtContinuousZoom", for CS and VB, alo0ng with the DotNET wrappers for the dlls. I am using the C# SmtContinuousZoom example. The two files I attached earlier - Form1.cs and Form1.Designer.cs contain all the code for the ZoomFFT example. Other files in the directory are the Visual Studio project and solution files, properties, etc.

0 Kudos
Message 5 of 12
(3,967 Views)

I found the download. For this version of the software, I didn't realize the .NET examples were a separate download.

 

While I look into this some more, can I ask why you're using this older toolkit? There are some newer versions of SMT available. Also, SMT as a whole has been replaced with RFmx SpecAn. RFmx SpecAn has roughly 40 different examples for .NET RF applications.

0 Kudos
Message 6 of 12
(3,956 Views)

Because that's what I was able to find via some searches for software that did demodulation. I didn't realize SMT had been replaced by RFmx SpecAn. Although I did see a few references to RFmx, it wasn't clear on initial reading that it included the .NET support and examples. Looking at it in more detail, I see that it does include .NET support. I am downloading it now and will report back if using this new package solves my problems.

0 Kudos
Message 7 of 12
(3,954 Views)

I am finally getting back to my FFT issue after several distractions. I downloaded and installed the RFmxSpecAn version 2.2. I found the examples, including one for Analysis Only (RFmxSpecAnAcpAnalysisOnly) - which is what I need since I'm collecting data from an independent acquisition system.

 

When I tried to build it, I found I also needed a full install of RFSA plus the .NET drivers. I now have those installed and it compiles cleanly. When I try to run it I get an error message:

  Ivi.Driver.IviDriverException: ModularInstruments.NIRfsa: Device identfier is invalid. Error code: -200220"

 

It's not clear what it's looking for. the "resourceName" is defined in the example code as "RFSA". I am using it unmodified. I have no actual RFSA hardware installed and I don't expect it to be looking for such hardware in this example. It is blowing up on the line:

    rfsaSession = new NIRfsa(rfsaResourceName, true, false);

 

A partial stack trace:

StackTrace = "   at NationalInstruments.ModularInstruments.NIRfsa.Internal.RfsaImpl.TestForErrorAndWarning(Int32 status)\r\n   at NationalInstruments.ModularInstruments.NIRfsa.Internal.RfsaImpl.InitWithOptions(String resourceName, Boolean iDQuery, Boolean reset, String ...

 

Any hints or suggestions would be appreciated. If you'd rather I start a new topic, since this is no longer directly related to SMT, I can do that, although it is related to my original problem of getting a working FFT function.

 

P.S. I just tried again with the "checklId" parameter set to false in the constructor call - same error.

0 Kudos
Message 8 of 12
(3,904 Views)

Hi brandle,

 

This example is designed to use hardware. The resourceName is the name of the hardware being used and "RFSA" is just the default value used in the example. All of the RFmx SpecAn functions are designed to be used with hardware. 

 

Can you describe your application for us? If you're not using hardware, then RFmx SpecAn may not be right for you. Where is the data for the FFT coming from? 

0 Kudos
Message 9 of 12
(3,894 Views)

Hi Matt,

 

I was afraid of that. The ZoomFFT example in the older SMT library generated a simple sine wave then ran an FFT on it. You had indicated that RFmx is the better way to go (and they do have many more examples) and I was hopeful when I saw the information in the help file where it states:

RFmx Analysis-Only Mode

The RFmx Analysis-Only Mode further extends the functionality and flexibility of the RFmx API to handle the following use cases:

  • Perform RF measurements with hardware that RFmx does not natively support
  • Perform RF measurements on simulated waveforms
  • Perform RF measurements on waveform data that was acquired previously and saved to disk

Bullet point 3 is my situation.

 

So, to elaborate, here's my setup:

  1. A variable frequency RF oscillator (around 2.9 GHz), mixed with an LO to down convert to around a 10 MHz IF
  2. A TI high speed digitizer eval board (ADS42JB69 EVM) connected to a TI TSW14J46 EVM (FPGA based acquisition and processing board).
  3. Using the software for the TSW14J46, I can download the digitized data to a PC, which is comprised of 262144 samples taken at a 250 MHz sampling rate.
  4. The VFO in (1) changes its frequency based on an external stimulus (light from an LED, in this case). The light intensity, and hence the frequency, may be constant or the light may be modulated, like with a sine wave which causes a corresponding modulated frequency shift in the RF.

What I want to do is read the time domain data from a disk file, use some software tool to run a FFT to get the frequency domain data and determine the peak frequency (like what RFmxSpecAnMarker provides), and in the case where the RF is modulated, do a demodulation to extract the modulation signal from the carrier.

 

Can I achieve this using RFmxSpecAn and RFmxDemod, and if not, what would you recommend? I would like to do this in C#.

 

    -Bill

0 Kudos
Message 10 of 12
(3,891 Views)