Hello Everyone, I need to pass a low pass filter in this plot and I can't find the best way to do that. Someone can help me? Thanks.

1 view (last 30 days)
Rita Gama
Rita Gama on 11 Oct 2021
Commented: Star Strider on 12 Oct 2021
Hello Everyone, I need to pass a low pass filter in this plot and I can't find the best way to do that. Someone can help me? Thanks.
I'm using this filter and I'm not getting any results
[b,a] = butter(8,0.1,'low');
y = filtfilt(b,a,pz);

Accepted Answer

Star Strider
Star Strider on 11 Oct 2021
Use the freqz function (or freqs linked to in that documentation page, if it is a continuous-time filter) —
[b,a] = butter(8,0.1,'low');
figure
freqz(b, a, 2^16)
Or, if the intent is the impulse response, the impz function —
figure
impz(b,a)
.
  5 Comments

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 12 Oct 2021
You are getting differences near the sharp edges.
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/764556/DATA.mat';
pz = readmatrix(filename, 'filetype', 'text');
[b,a] = butter(8,0.1,'low');
y = filtfilt(b,a,pz);
plot(pz, 'k.-', 'displayname', 'original');
hold on
plot(y, 'b+-', 'displayname', 'filtered');
hold off
legend show
xlim([6050 6199])
figure
plot(pz - y, 'displayname', 'pz-y')
legend show
  2 Comments
Walter Roberson
Walter Roberson on 12 Oct 2021
I am having difficulty at the moment figuring out how a vector of values might correspond to values from a point cloud, so I am having difficulty judging what kind of noise might be present or what an effective way of reducing it might be.
The only idea I have come up with so far is that you might possibly be scanning a linear structure with pits, such as for CDs.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!