How to subtract average value from a signal?
조회 수: 8 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!