Effacer les filtres
Effacer les filtres

Counts the number of times the signal crosses zero

1 vue (au cours des 30 derniers jours)
Ahmed Alalawi
Ahmed Alalawi le 11 Fév 2020
Réponse apportée : dpb le 11 Fév 2020
Hello there
I trying to counts the number of times the signal crosses zero. I am using this syntax (zcd = dsp.ZeroCrossingDetector) to do that, but Matlab helps showing me an error “Dot indexing is not supported for variables of this type.”.
zcd = data.ZeroCrossingDetector;
numZeroCross = zcd(data)
release (zcd)
I have attached the data file.
Could any one help with that?
Thank you

Réponses (1)

dpb
dpb le 11 Fév 2020
Use
zcd = dsp.ZeroCrossingDetector;
to create the object per the documentation. Then you pass that object the data...
numZeroCross = zcd(data)
release (zcd)
should work presuming the .mat file contains a vector or array data
Most interesting/peculiar it counts peaks but doesn't also optionally return locations...one would have to repeat the work to do that as well.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by