analogdevicesinc / iio-oscilloscope

A GTK+ based oscilloscope application for interfacing with various IIO devices

Home Page:https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plot update

cuciureansergiu opened this issue · comments

After changing the sampling frequency for an ADC, the FFT plot is showing the data based on the old sampling rate.
For example, on a sinewave of 10khz:
default samping rate, reads 10khz
1/2 sampling rate, reads 20khz,
1/4 sampling rate, reads 40khz
Each time the sampling frequency is changed, osc has to be restarted (closing the plot window and opening another one won't fix this).

Where are you seeing this?
I think this is typically handled by the plugins.

Here are some screenshots for a 5 khz sinewave and changing only the sampling frequency for the axi_adc:

image
image

After i restart osc

image

Seems like the graph data is stored once, when osc starts

Typically the plugin calls rx_update_device_sampling_freq(). In your case you use the DEBUG plugin and manipulate attributes.

One idea is to have oscplot guess which attribute is for changing the sampling frequency (if plugin doesn't call rx_update_device_sampling_freq() or if there is no plugin). Then oscplot would read that attribute exactly when the start button gets clicked. This way, the sampling rate would get updated next time the capture is started which is better than having to restart the entire aplication.

Can't we check the sampling frequency each time the START button is pressed?

@dNechita , I was thinking the same. :)

I guess we do this already for computing the timeout in capture_setup()

A fix for this has been made. Closing this issue.