Shivalnu
Shivalnu

Reputation: 119

Signal Filtering with matlab

I have some values in a .txt file and I load them into Matlab using the importdata command like so:

A=importdata('Step_Response.txt');

t = A(1:end, 1);
y = A(1:end, 2);

When plotting this data I get the following plot: enter image description here

How would I proceed with clearing this up so I would get something that resembles a line?

So far I have tried this:

b = 50;
coeff= ones(1, b)/b;
avg = filter(coeff, 1, y);
plot(t,[y avg])

This is the resulting plot: enter image description here

Is this the correct way to do this and can I get a clearer line towards the end?

Upvotes: 0

Views: 117

Answers (1)

geoinformatic
geoinformatic

Reputation: 166

If you know the function type and parameters of a noise, then you can build a specific filter. For example, I have used the sigmoidal function and the uniformly distributed of a noise.

enter image description here

Else, you can use the Curve Fitting Tool (in main menu: APPS → Curve Fitting) and find a filter type that satisfies you.

enter image description here

Upvotes: 1

Related Questions