How to subtract average value from a signal?

10 ビュー (過去 30 日間)
Saulius Janusauskas
Saulius Janusauskas 2018 年 5 月 27 日
編集済み: Image Analyst 2018 年 5 月 27 日
Hi all,
I have this case where I add offset in analog circuit to a signal and then once I sample the signal, I want to remove this offset by the same value. Has anyone got any ideas how to calculate and subtract offset of this signal in MATLAB?

採用された回答

Image Analyst
Image Analyst 2018 年 5 月 27 日
編集済み: Image Analyst 2018 年 5 月 27 日
Did you try using minus instead of plus?
yNew = y + offset; % What you've already done.
% Now subtract from the signal using the "minus" operation
yNew2 = yNew - offset; % Should equal the original y signal.
offset can be whatever you want. If you want it to be the average of the signal do
offset = mean(y);
offset = mean(yNew); % Or this if you want.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by