|
1 | 1 | module Util
|
2 | 2 | using ..DSP: @importffts
|
3 |
| -import FFTW: fftwReal, fftwComplex, fftwNumber |
4 | 3 | import Base: *
|
5 | 4 | @importffts
|
6 | 5 |
|
@@ -49,7 +48,7 @@ function unwrap(m::Array{T}, args...; kwargs...) where T<:AbstractFloat
|
49 | 48 | unwrap!(copy(m), args...; kwargs...)
|
50 | 49 | end
|
51 | 50 |
|
52 |
| -function hilbert(x::StridedVector{T}) where T<:fftwReal |
| 51 | +function hilbert(x::StridedVector{T}) where T<:FFTW.fftwReal |
53 | 52 | # Return the Hilbert transform of x (a real signal).
|
54 | 53 | # Code inspired by Scipy's implementation, which is under BSD license.
|
55 | 54 | N = length(x)
|
@@ -104,18 +103,18 @@ end
|
104 | 103 | ## FFT TYPES
|
105 | 104 |
|
106 | 105 | # Get the input element type of FFT for a given type
|
107 |
| -fftintype(::Type{T}) where {T<:fftwNumber} = T |
| 106 | +fftintype(::Type{T}) where {T<:FFTW.fftwNumber} = T |
108 | 107 | fftintype(::Type{T}) where {T<:Real} = Float64
|
109 | 108 | fftintype(::Type{T}) where {T<:Complex} = Complex128
|
110 | 109 |
|
111 | 110 | # Get the return element type of FFT for a given type
|
112 |
| -fftouttype(::Type{T}) where {T<:fftwComplex} = T |
113 |
| -fftouttype(::Type{T}) where {T<:fftwReal} = Complex{T} |
| 111 | +fftouttype(::Type{T}) where {T<:FFTW.fftwComplex} = T |
| 112 | +fftouttype(::Type{T}) where {T<:FFTW.fftwReal} = Complex{T} |
114 | 113 | fftouttype(::Type{T}) where {T<:Union{Real,Complex}} = Complex128
|
115 | 114 |
|
116 | 115 | # Get the real part of the return element type of FFT for a given type
|
117 |
| -fftabs2type(::Type{Complex{T}}) where {T<:fftwReal} = T |
118 |
| -fftabs2type(::Type{T}) where {T<:fftwReal} = T |
| 116 | +fftabs2type(::Type{Complex{T}}) where {T<:FFTW.fftwReal} = T |
| 117 | +fftabs2type(::Type{T}) where {T<:FFTW.fftwReal} = T |
119 | 118 | fftabs2type(::Type{T}) where {T<:Union{Real,Complex}} = Float64
|
120 | 119 |
|
121 | 120 | ## FREQUENCY VECTOR
|
|
0 commit comments