How to set sample values to zero

9 Ansichten (letzte 30 Tage)
Amber Binney
Amber Binney am 19 Mai 2022
Beantwortet: Voss am 19 Mai 2022
I need to find samples of my noisy signal that are below the noise amplitude and set those to zero. Thank you for any help

Antworten (1)

Voss
Voss am 19 Mai 2022
Use x(x < threshold) = 0, where x is your signal and threshold is your noise amplitude. Or x(abs(x) < threshold) = 0, if you meant the amplitude of the signal is below the noise amplitude.
Here's a concrete example:
% random signal
x = 0.25*rand(1,20);
plot(x,'-o');
hold on
% set values below 0.1 to 0:
x(x < 0.1) = 0;
plot(x,'.-');
legend({'original' 'new'})

Kategorien

Mehr zu Audio Processing Algorithm Design finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by