Jump to content
  • 0

Spectrum Analyzer Python script Analog Discovery 2.


Ostin Flores

Question

Hi all,

I am writting an script to determine the Spectrum Analysis of a signal with the Analog Dicovery Board 2. When using the AnalogIn_spectrum.py I obtain the FFT data and then plot it, it seems like the data comes in as dBV/HZ but I want to convert this value to V/Root(HZ). Is there an easy way to do this?

The following Lines in the AnalogIn_spectrum.py example get the FFT data in Volts (rgdBins1) and convert it into dBV/HZ 

 

for i in range(nBins):

    rgdBins1[i] = 20.0*math.log10(rgdBins1[i]/sqrt2) # to dBV

    rgdBins2[i] = 20.0*math.log10(rgdBins2[i]/sqrt2) # to dBV

 

So what should I do to rgdBins1[i] to convert the data into V/Root(Hz)?

My second concern has to do with a small DC value that is recorded at 0Hz (See picture). What does it represent? I do not have an input voltage to the signal displayed. Your help is highly appreciated.

image.thumb.png.88b2793067637fcf8f05ff9896c7eefb.png

Software Version 3.20.33 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

This is for a Linear RMS Averaging like the one perfomed in the Waveforms application. I collected various samples and then performed a Root Mean Square of the incomming samples and I do not get the results that you get.

Root Mean Square formula Xrms= sqrt[(X1^2 + X2^2 + X3^2 ... + XN^2)/N]

N is the number of averages

XN is the FFT Data

image.thumb.png.d9e925ba7a2a7ae975f69010b421949b.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...