I have a signal/vector with high amplitude white gaussian noise and I'm trying to get a binary signal (0 or 1). The sampling frequency is 10Hz.
I applied a simple 2nd order Butterworth filter in MATLAB as follows;
x=sig_bruit_BB1;
[b,a]=butter(2,0.1,'low');
y = filter(b,a,x);
plot(x)
subplot(3,1,2)
plot(y)
for i=1:1:1820
x=y(1,i);
if (x<0.5)
code(1,i)=0;
else
code(1,i)=1;
end
end
subplot(3,1,3);
plot(code)
As you can see, I did a for loop assuming that any signals smaller than 0.5 is equal to 0 and greater equals to 1.
Can somebody verify if this method is applicable to obtain a binary signal ?
Thanks.