Compute the frequencies from time for an FFT
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | t | Sample times of input signal to FFT |
Frequencies of FFT output
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
function FFT_freq(t) result(f)
!! Compute the frequencies from time for an FFT
real(wp),dimension(:),intent(in)::t
!! Sample times of input signal to FFT
real(wp),dimension(:),allocatable::f
!! Frequencies of FFT output
integer::N,k
N = size(t)
allocate(f(N))
do k=1,N
f(k) = real(k-1,wp)/( t(N)-t(1) )
end do
end function FFT_freq