Spike at the start of discrete integration.

I have an angular displacement in Yaw at a 100Hz sampling rate. When I try to differentiate it, I get a spIke at the first sample point of velocity and 2 spikes in the first 2 samples of acceleration. I plan on passing this into a low pass filter so I can't ignore these samples either unfortunately. What am I doing wrong that causes the spikes at the start of my differentiated channel?
The Blue line is Velocity and yellow is Acceleration in the attached scope image.

4 commentaires

Paul
Paul le 7 Déc 2023
Probably relate to the Initial Condition parameter of the Discrete Derivative block(s).
Can you upload Yaw_Data in a .mat file (use the paper clip icon on the Insert menu) or show the three signals on three separate scopes?
This is my yaw data displacement to acceleration left to right.
Paul
Paul le 7 Déc 2023
Zoom in on each scope for the first 0.040 seconds like in the attached JPEG so we can see what's going on with each signal in the time of interest.
Here's the first few samples. The only thing to note is the offset from zero on the displacement data but the dispalcement value doesn't change in this zoom window.

Connectez-vous pour commenter.

 Réponse acceptée

Paul
Paul le 8 Déc 2023
Modifié(e) : Paul le 8 Déc 2023

1 vote

In the first Discrete Derivative block that computes the rate, try setting the parameter "Initial condition for previous weighted input K*u/Ts — Initial condition" to Yaw_Data(1)/Ts, where Ts is 0.01 (or whatever is the Sample Time of the signal driving that block). That should smoot things out for the first couple of sample when Yaw_Data is constant. There will still be a transient when the Yaw_Data changes. Hopefully it doesn't change too much from sample to sample. Estimating acceleration from position can be difficult. Instead of a pure differentiator, maybe a high pass filter would be better.
Also, perhaps combining the differentation and the low pass filter into a single filter would be beneficial, unless you need the rate and acceleration signals explicitly for some other reason.

Plus de réponses (0)

Catégories

En savoir plus sur Signal Generation, Manipulation, and Analysis dans Centre d'aide et File Exchange

Produits

Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by