Reputation: 119
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:
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])
Is this the correct way to do this and can I get a clearer line towards the end?
Upvotes: 0
Views: 117
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.
Else, you can use the Curve Fitting Tool (in main menu: APPS → Curve Fitting) and find a filter type that satisfies you.
Upvotes: 1