I would like to add and plot the spectrum of signal on Qwt Oscillocope's example. My Idea is to create another seriesData class. SerieData. I wonder if there will not conflict between sample of SeriesData and sample of Signaldata or I just need to modify the signaldata? Any help and Advice would be appreciated. Thanks
相关问题
- Sorting 3 numbers without branching [closed]
- QML: Cannot read property 'xxx' of undefin
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Class layout in C++: Why are members sometimes ord
- How to plot smoother curves in R
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
input signal is usually in form of cyclic buffer the output buffer can be static one. This applies also for time domain plots. Without actually see your structures is impossible to answer if you had to change them or not Here is how I do this:
make some buffer (array) for FFT
can be static ... No changes in it will happen. It size has to be at least
slowest_timebase/fsampling
samples. In case your FFT has complex domain input then double the size. If you want to scroll/zoom/unzoom then enlarge the size accordinglyfind the start sample of the actual Oscilloscope view
via trigger or for starters just last N-samples (but it will flicker because of phase ...) or you preview all samples by N-sample chunks from start to end with the same speed as sampling. Similar like you would send data to sound-card to play sound. You just start after some time so you have enough sampled data already ...
process data
Copy data from start point to FFT buffer add imaginary part of samples if needed (
Im=0.0
) and process FFT. Then plot the first half of real output.The frequency of
i
-th sample (out ofN
) isf=i*samplerate/N [Hz]
wherei={ 1,...,(N/2)-1}
skippingi=0
which represents DC component.You can also add logarithmic axises to frequency. In that case do not forget to change the
x
value in plot tooupdate start position
simply add to start position the size of used samples (
N
) and do not forget that trigger also use this time as start point before finding the real start...