Equivalent time sampling in Matlab

2 views (last 30 days)
want2know
want2know on 24 Jul 2015
Commented: Walter Roberson on 28 Jul 2015
I am sending data from fpga (nios ii processor) to serial port and Matlab access the serial port and plot real time graph. The Nios II is 50MHz, so it has no issue to receive the data from fpga which is 50Hz
If the serial port receive rate is just 8Hz, but the data sent to serial port is 50Hz, what approach is Matlab using to plot the graph? Does it have anything to do with equivalent time sampling (ETS)? I could not find any links between Matlab and ETS, correct me if I am wrong.
Appreciate any inputs.. thank you
  7 Comments
want2know
want2know on 28 Jul 2015
Edited: want2know on 28 Jul 2015
Thank you for your kind reply... I did set the baud rate to be 11.5kbps, then I send the data from Altera Nios hardware to serial port, Matlab access the serial port and plot the graph, this assumption is used to calculate the receive rate
"packets are sent out at a fixed dt rate which is very accurate because it is clocked by the Altera Nios. The dt period is calculated by looking at the number of packets received over a long period. The first 100 packets are ignored as Matlab might be busy emptying the serial buffer during this startup period, so 1/dt is the receive rate that I obtained (8 Hz)
dt = (t(end) - t(100)) / (length(t) - 101);
The incoming signal is 50 Hz, which means I am supposed to see a sinusoidal waveform every 0.02 seconds, from the results, I still can see a sinusoidal waveform but a complete sinusoidal waveform is plotted every 12 seconds, so I was thinking is it that Matlab use Equivalent Time Sampling to plot this result in my case? Or do you have any idea in mind so I can google for the details?
Thank you in advance.
Walter Roberson
Walter Roberson on 28 Jul 2015
115200 baud would be 11520 characters per second. That should be enough to get 20 groups of 576 characters if the serial configuration is set right. Please show the MATLAB code for your serial setup.
You have not mentioned anything about how you are doing the plotting. I doubt that any Equivalent Time Sampling is involved, but you have not described the plotting calls. Are you using a Simulink Scope block? If so then how do you have it configured?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!