Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the unit of adc-dac-dma raw data? #559

Open
hansmdau97 opened this issue Feb 12, 2023 · 3 comments
Open

What is the unit of adc-dac-dma raw data? #559

hansmdau97 opened this issue Feb 12, 2023 · 3 comments

Comments

@hansmdau97
Copy link

hansmdau97 commented Feb 12, 2023

Hi team,

I am trying to measure the NEP of a PD using alpha250.

Referring to the site here (https://www.koheron.com/blog/2018/01/22/measuring-photodetector-noise-equivalent-power)

When using the adc-dac-dma example(https://github.com/koheron/koheron-sdk/blob/master/examples/alpha250/adc-dac-dma/test.py), I wonder what the unit of adc raw data is.

The equipment used is koheron DRV200, Koheron PD01, Alpha250

@tvanderbruggen
Copy link
Member

Hi,

The ADC data are not converted into a physical unit, they are the raw ADC data stored in a 16 bits integer.
Knowing the ADC input span input_range in Volts (typ. 1 Vpp on 50 Ohm), you can convert the raw data into Volts.
For example converting channel 0 data to Volts:

data0_volts = driver.adc[0] * input_range / 2**16

The Ltc2157 driver provides the calibrated input range.
You can add this function to the class AdcDacDma

  @command(classname="Ltc2157")
  def get_input_voltage_range(self, channel):
      return self.client.recv_float()

and then use it as

data0_volts = driver.adc[0] * driver.get_input_voltage_range(0) / 2**16

You can check your code by sending a sine of known amplitude over 50 Ohm and compared to the DMA data rescaled with the input_range factor.

I hope this answers your question.

@hansmdau97
Copy link
Author

hansmdau97 commented Mar 23, 2023

Your answer was very helpful thank you.

And I have another question. I am trying to find the voltage noise density using the data received using the adc-dac-dma instrument.

Is there a way to use the functions of the FFT instrument while using the adc-dac-dma instrument? KeyError: 'FFT' was output when the required function was added with command(classname = "FFT")

@tvanderbruggen
Copy link
Member

No, only one instrument is running at the time, because it is not the same logic running on the FPGA.

But you can compute the FFT of the adc-dac-dma data using numpy on the python side.
See for example https://github.com/Koheron/koheron-sdk/blob/master/examples/alpha15/adc-dac-dma/test_fft.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants