Normalizing an FFT Vector
Mostra commenti meno recenti
Hey all,
I am currently trying to understand how exactly to normalize an fft eigenstate in the context of the 1-d particle in an infinite well. My code is as below:
L = 100;
x = linspace(0,L,L+1);
psi = sqrt(2/L)*sin(pi*x/L); %particle in a box ground state%
norm = trapz(x,psi.*conj(psi)); %normalized state has L-2 norm = 1%
F_T = fft(psi);
norm2 = trapz(2*pi*x/L, F_T.*conj(F_T));
The psi is the discretized array for my particle in position space that, as calculated in "norm", has L-2 norm of 1. Now I wanted to transform this into momentum space via the fft, but when I try to get the L-2 norm of it again as in "norm2", the norm is no longer 1. I have seen suggestions of dividing the fft by
online but it doesn't seem to resolve the issue either. Any advice would be appreciated.
Thanks!
Risposta accettata
Più risposte (1)
Try with fftshift function ,
L = 100;
x = linspace(0,L,L+1);
psi = sqrt(2/L)*sin(pi*x/L); %particle in a box ground state%
%<<norm is standard builtin function in matlab
Norm = trapz(x,psi.*conj(psi)) %normalized state has L-2 norm = 1%
F_T = (fftshift(psi));
F_T = norm(F_T)
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







