EDIT: I would like to make a plot based on the following code:
function one(varargin)
thresh = 200;
setenv GNUTERM 'x11';
x = [0.05:0.05:10];
x = transpose(x);
y = rand(200, 1);
y(y <= 0.9) = 0.9;
plot(x, y);
xlabel('time');
ylabel('values above thresh');
end
… The thing is, I don’t want it to be just jumpy points. It would be nice to see the values smoothly undulating from one to the next (like a bezier curve). Is this possible?
I don’t know if I would need an external library for this, but I’m willing to go that route if necessary. It would be nice to export the resulting (smooth) plot at any data resolution.
If I’m reading this correctly, you just want to downsample this information, which is quite an easy, efficient task in octave.
Given xi,yi as your original dataset, and you’d like to do roughly 10x downsampling:
Generate a new x vector, xp (assuming xi is montotonic increasing):
Then use interpolation with a spline method:
However, this only smooths the interpolated data.
I didn’t really follow parts of your question – how do you define essential portions?
An alternative could be to filter the data before you downsample, for example, with a Savitsky-Golay filter. The fun thing here is that there’s a few parameters you can play with. For a default:
This filter uses a smoothing polynomial of order p and length n to process your data. IF you specify p and n, you can play around with what might work best: