フィルターのクリア

Retrieving RMS of a signal with variable sample rate

16 ビュー (過去 30 日間)
Greg
Greg 2024 年 7 月 19 日 13:51
回答済み: Greg 約17時間 前
Hello community,
I'm using PLECS, with a variable solver, and would like to postprocess its data within matlab. Trying to extract the RMS value of signals has been a struggle, as the sampling rate increases a lot when there are transient phenomena. Therefore, using rms(values) gives me an extremely higher rms value than the expected, as I am working with pulsed values. Also changing to a discrete solver to have equal sampling rate, is not wanted because it's much slower.
I've been looking at a method to attach the timestamps in my signals somehow, to work around this problem. Yet, I'm not having any luck. Does anyone know of an available function or code snipper to figure this out, please?
Thank you for any help.
  1 件のコメント
Mathieu NOE
Mathieu NOE 2024 年 7 月 19 日 15:46
if we had the timestamps we could resample the data with fixed sampling rate and do the rms computation
I assume that if PLECS is able to plot the results, those timestamps should be available somewhere...

サインインしてコメントする。

回答 (2 件)

dpb
dpb 2024 年 7 月 19 日 14:54
Straightforward, deadahead solution would be something like
y=resample(y,tx,fs);
y_rms=rms(y);
where y is your beginning signal y resampled at the time points tx using a polyphase antialiasing filter at the uniform sample rate specified in fs. tx --> [0 : 1/fs : T]. <resample> is in the Signal Processing TB.
Lacking it, use a timetable and retime; multilple choices of interpolation method.
This has the possibility of creating memory issues if the minimum dt of your solution vector is extremely small; you might be forced to more clever soutions weighting sections of the overall signal by the length in time.

Greg
Greg 約17時間 前
Thank you all for the suggestions. I've found the answer in the PLECS manual, although the given answers likely work, with bigger computational need.
For anyone who might have the same issue in the future, you can return PLECS scope measurements in matlab using the commands:
plecs('scope', 'scopePath', 'GetCursorData', [t1 t2], ...
'analysis1', 'analysis2', ...)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by