discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Discuss-gnuradio] RF Analysis


From: Richard Cagley
Subject: RE: [Discuss-gnuradio] RF Analysis
Date: Wed, 11 May 2005 10:16:29 -0700

If you have a GPIB card, you can use a simple program like this to log data
points in a range of spectrum. This was for an HP spectrum analyzer, but if
you're using visa it shouldn't matter.


// SpectrumSurvey.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <visa.h>
#include <windows.h>
#include <iostream>
#include <fstream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
  ofstream OutputFile("spectrum.dat", ios::out);

  if (!OutputFile)
  {
    cerr<<"File could not be opened"<<endl;
    return -1;
  }

  ViSession defaultRM, vi;
  char buf [256] = {0};
  char buf2 [256] = {0};

  // set the parameters for measurement: in kHz
  int StartFreq = 210000;
  int StopFreq = 240000;
  int StepFreq = 25; 
  int NumberRuns = 1;

  // write out the frequencies in the header
  int CurrentFreq = StartFreq;
  while (CurrentFreq < StopFreq)
  {
    OutputFile<<CurrentFreq<<", ";
    CurrentFreq += StepFreq;
  }
  OutputFile<<endl;

  // Open session to GPIB device at address 18
  viOpenDefaultRM (&defaultRM);
  viOpen (defaultRM, "GPIB5::18::INSTR", VI_NULL,VI_NULL, &vi);

  viPrintf (vi, "ID?\n");
  viScanf (vi, "%t", &buf);
  printf ("Instrument identification string: %s\n", buf);


  double ChannelPower;
  // main loop to do measurements
  for (int n = 0; n < NumberRuns; ++n)
  {
    CurrentFreq = StartFreq;
    while (CurrentFreq < StopFreq)
    {
      viPrintf( vi,"IP;SNGLS\n");
      viPrintf(vi, "FA %dMHZ\n", CurrentFreq);
      viPrintf(vi, "FB %dMHZ\n", CurrentFreq+StepFreq);
      viPrintf(vi, "CHP\n");
      Sleep(1000*10);
      viPrintf(vi, "*CHPWR?\n");
      viScanf(vi,"%lf",&ChannelPower);
      OutputFile<<ChannelPower<<", ";
      CurrentFreq += StepFreq;
    }
    OutputFile<<endl;
  }

  viClose (vi);
  viClose (defaultRM);
  
  return 0;
}

> -----Original Message-----
> From: address@hidden [mailto:discuss-
> address@hidden On Behalf Of SIGINT Admin
> Sent: Wednesday, May 11, 2005 9:03 AM
> To: address@hidden
> Subject: [Discuss-gnuradio] RF Analysis
> 
> Hi
> 
> I was wondering if any of you guys had links or pointers to general
> good quality RF analysis and logging software?
> 
> Ideally it would be compatible with the likes of the gnu radio
> hardware, but could also be interfaced to drive an agilent spectrum
> analyser or similar....
> 
> Any tips or thought welcome
> 
> Many thanks
> 
> Mochara
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]