Detect signal clipping and remove
22 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a signal from a microphone that is listening for respiratory audio. When the test subject talks or moves too much, the signal clipps. I am not interested in data that occurs when the subject is talking but I am trying to figure out how to eliminate these sections of the signal from my file. Either remove them entirely, or replace them with a mid level value.
Would anyone here have a good suggestion as to how I could execute this?
Thank you very much in advanced.
0 件のコメント
回答 (3 件)
Star Strider
2021 年 7 月 22 日
編集済み: Star Strider
2021 年 7 月 30 日
Without an example signal, I am guessing that the ‘clipped’ or ‘railed’ parts of the sound would be equal to ±1, with the valid data being within those limits, however not equal to them. One option would be to set all the values equal to ±1 as NaN, then use rmmissing to delete them, or similar functions (all introduced in R2016b) to interpolate them.
It will likely be necessary to experiment to get the result you want.
—————
EDIT — (30 Jul 2021 at 18:26)
With respect to your Comment, choose a threshold slightly less than 1, (or sllightly greater than 0, or both), assign NaN to all values exceeding than that threshold in either direction, then use rmmissing to delete them. I would need the actual data to write and test specific code.
.
2 件のコメント
Star Strider
2021 年 7 月 30 日
The rmmissing function was introduced in R2016b, as was fillmissing that would replace them with 0 or alternatively interpolate the missing values. We have no idea what version or rlelease you are using, since that was not posted. (I assume the latest release unless otherwise stated.)
An alternative would be to simply set the values exceeding the thresholds to 0. That would essentially remove them without disrupting the rest of the file, or the associated time vector (if one exists).
.
Image Analyst
2021 年 7 月 22 日
Try this
clipValue = max(yourSignal); % Assume clipping occurs, or else just assign some known value, like 1.
badIndexes = yourSIgnal == clipValue;
% Set those elements to zero (won't change the time scale);
yourSignal(badIndexes) = 0;
% Or, delete those elements to zero (will change the time scale);
yourSignal(badIndexes) = [];
If you need more help, attach your signal in a .mat file with the paperclip icon along with a screenshot indicating what values you'd like to process, and whether you'd like to delete them or just set them to zero.
0 件のコメント
Kcire L
2021 年 7 月 30 日
1 件のコメント
Image Analyst
2021 年 7 月 31 日
Remember when I said "If you need more help, attach your signal in a .mat file with the paperclip icon along with a screenshot indicating what values you'd like to process, and whether you'd like to delete them or just set them to zero."?
Well you attached the screenshots, and that's good, but what can we do now? Nothing, because you forgot to attach the signal in a .mat or text file.
参考
カテゴリ
Help Center および File Exchange で Measurements and Spatial Audio についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!