Effacer les filtres
Effacer les filtres

How to take the absolute value for 2D spectrum?

5 vues (au cours des 30 derniers jours)
Ilya Grishanovich
Ilya Grishanovich le 21 Avr 2022
I have 2D spectrum with positive(blue) and negative(red) signals, I want to make all signals positive and to save the received spectra.
How to make it? (thank you in advance)

Réponse acceptée

Hiro Yoshino
Hiro Yoshino le 21 Avr 2022
try function "abs":
t=-pi:0.01:pi
t = 1×629
-3.1416 -3.1316 -3.1216 -3.1116 -3.1016 -3.0916 -3.0816 -3.0716 -3.0616 -3.0516 -3.0416 -3.0316 -3.0216 -3.0116 -3.0016 -2.9916 -2.9816 -2.9716 -2.9616 -2.9516 -2.9416 -2.9316 -2.9216 -2.9116 -2.9016 -2.8916 -2.8816 -2.8716 -2.8616 -2.8516
y= sin(t);
plot(t,y);
y2 = abs(y);
plot(t,y2);
?

Plus de réponses (1)

Matt J
Matt J le 21 Avr 2022
spectra=abs(spectra)
  1 commentaire
Ilya Grishanovich
Ilya Grishanovich le 21 Avr 2022
Modifié(e) : Ilya Grishanovich le 21 Avr 2022
Thanks, I'll try.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by