The filtfilt function is different in different versions

6 vues (au cours des 30 derniers jours)
中祥 范
中祥 范 le 31 Mai 2024
Réponse apportée : Abhiram le 21 Fév 2025
When I used filtfilt in version R2019b, I had to use input data in double format, but in version R2024, functions can recognize data in single format.But when I increased the order of the filter from second to third order, it became clear that the single format version produced the wrong result, and the result using the double version is still right.
I want to know why, please help me.
  2 commentaires
Infinite_king
Infinite_king le 31 Mai 2024
Can you provide the exact input values ?

Connectez-vous pour commenter.

Réponses (1)

Abhiram
Abhiram le 21 Fév 2025
When single-precision input is given, the filter coefficients of the ‘filtfilt’ function will be quantized to single precision.
The incorrect results with single precision data are especially evident when the filter order increases, as the numerical precision required exceeds what single precision can reliably provide.
Use of double-precision input can offer better stability and accuracy, which is crucial for higher-order filters.

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by