Results 1 to 6 of 6

Thread: Real time plotting from hardware

  1. #1
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Real time plotting from hardware

    I want to plot the real time output from a piece of hardware through its ADC. It is not a sine or square function but it is periodic in the sense that the start of samples to the sample size is periodic. The output has no zero crossings - it is essentially positive. I use a plot widget from the designer (all the UI widgets are laid out in the designer). Does the Qwt oscilloscope example represent the best way to implement this type data acquisition or is there a better example? I have version 6.1 rc3 version of Qwt.

    Thanks for any help

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Real time plotting from hardware

    oscilloscope is more a demo than an example - showing what is possible with almost no CPU usage. F.e the curve always grows from left to right to be able to draw incrementally. But its code is not intended as a beginner tutorial.

    One thing that is important for your type of plot: decouple data acquisition ( sample rate ) from the the refresh rate ( QwtPlot::replot ). This can be done easily, by setting up a timer that increments the scale interval ( QwtPlot::setAxisScale ) periodically. Also it is a good idea to understand QwtSeriesData<QPointF> for your concept how to pass or share your sample buffer with the corresponding curve.

    Uwe

  3. #3
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Real time plotting from hardware

    Quote Originally Posted by Uwe View Post
    oscilloscope is more a demo than an example - showing what is possible with almost no CPU usage. F.e the curve always grows from left to right to be able to draw incrementally. But its code is not intended as a beginner tutorial.
    Uwe
    Thanks for that reply. I was using the reference of the oscilloscope as a "basis" for taking samples in a separate thread and displaying them periodically. That seemed like a good starting point.

    One thing that is important for your type of plot: decouple data acquisition ( sample rate ) from the the refresh rate ( QwtPlot::replot ). This can be done easily, by setting up a timer that increments the scale interval ( QwtPlot::setAxisScale ) periodically. Also it is a good idea to understand QwtSeriesData<QPointF> for your concept how to pass or share your sample buffer with the corresponding curve.
    Would you please expand on decoupling DA from the refresh rate? They are synchronous. If I understand what your getting at, a QwtSystemClock object would manage the data sample rate and a QBasicTimer would handle the refresh rate for each timer tick.
    Last edited by astodolski; 14th April 2013 at 13:07.

  4. #4
    Join Date
    Nov 2012
    Location
    Kentucky, USA
    Posts
    46
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Real time plotting from hardware

    Here: http://www.music.mcgill.ca/~gary/rtfft/
    is source code in Qt/Qwt that you may find useful.

    It does require some simple changes if you are using Qt 5 and latest Qwt.

  5. #5
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Real time plotting from hardware

    Quote Originally Posted by K4ELO View Post
    Here: http://www.music.mcgill.ca/~gary/rtfft/
    is source code in Qt/Qwt that you may find useful.

    It does require some simple changes if you are using Qt 5 and latest Qwt.
    I'll give it a look, thanks.

  6. #6
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Unhappy Re: Real time plotting from hardware

    Simple changes to say the least. fftw library doesn't appear to be able to build on a Windows platform. It also assumes Qwt is not installed already - using a local Qwt.
    Last edited by astodolski; 15th April 2013 at 13:40.

Similar Threads

  1. Replies: 3
    Last Post: 28th June 2013, 16:04
  2. Qwt real time plotting
    By santoshpradeep in forum Qwt
    Replies: 8
    Last Post: 28th June 2012, 09:53
  3. Real time data plotting using Qwt
    By nagabathula in forum Qwt
    Replies: 8
    Last Post: 7th July 2011, 16:47
  4. real time plotting
    By agostain in forum Qwt
    Replies: 0
    Last Post: 10th August 2009, 10:47
  5. real time plotting
    By gyre in forum Qwt
    Replies: 4
    Last Post: 11th December 2007, 16:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.