@@ -256,7 +256,7 @@ summary(p::ScaledPlan) = string(p.scale, " * ", summary(p.p))
256256* (p:: Plan , I:: UniformScaling ) = ScaledPlan (p, I. λ)
257257
258258# Normalization for ifft, given unscaled bfft, is 1/prod(dimensions)
259- normalization (T , sz, region) = one (T) / Int (prod ([sz... ][[region... ]])):: Int
259+ normalization (:: Type{T} , sz, region) where T = one (T) / Int (prod ([sz... ][[region... ]])):: Int
260260normalization (X, region) = normalization (real (eltype (X)), size (X), region)
261261
262262plan_ifft (x:: AbstractArray , region; kws... ) =
@@ -316,19 +316,17 @@ transformed dimensions (of the real output array) in order to obtain the inverse
316316"""
317317brfft
318318
319- function rfft_output_size (x:: AbstractArray , region)
319+ rfft_output_size (x:: AbstractArray , region) = rfft_output_size (size (x), region)
320+ function rfft_output_size (sz:: Dims{N} , region) where {N}
320321 d1 = first (region)
321- osize = [size (x)... ]
322- osize[d1] = osize[d1]>> 1 + 1
323- return osize
322+ return ntuple (d -> d == d1 ? sz[d]>> 1 + 1 : sz[d], Val (N))
324323end
325324
326- function brfft_output_size (x:: AbstractArray , d:: Integer , region)
325+ brfft_output_size (x:: AbstractArray , d:: Integer , region) = brfft_output_size (size (x), d, region)
326+ function brfft_output_size (sz:: Dims{N} , d:: Integer , region) where {N}
327327 d1 = first (region)
328- osize = [size (x)... ]
329- @assert osize[d1] == d>> 1 + 1
330- osize[d1] = d
331- return osize
328+ @assert sz[d1] == d>> 1 + 1
329+ return ntuple (i -> i == d1 ? d : sz[i], Val (N))
332330end
333331
334332plan_irfft (x:: AbstractArray{Complex{T}} , d:: Integer , region; kws... ) where {T} =
@@ -432,7 +430,7 @@ Return the discrete Fourier transform (DFT) sample frequencies for a DFT of leng
432430bin centers at every sample point. `fs` is the sampling rate of the
433431input signal, which is the reciprocal of the sample spacing.
434432
435- Given a window of length `n` and a sampling rate `fs`, the frequencies returned are
433+ Given a window of length `n` and a sampling rate `fs`, the frequencies returned are
436434
437435```julia
438436[0:n÷2-1; -n÷2:-1] * fs/n # if n is even
@@ -467,7 +465,7 @@ The returned `Frequencies` object is an `AbstractVector`
467465containing the frequency bin centers at every sample point. `fs`
468466is the sampling rate of the input signal, which is the reciprocal of the sample spacing.
469467
470- Given a window of length `n` and a sampling rate `fs`, the frequencies returned are
468+ Given a window of length `n` and a sampling rate `fs`, the frequencies returned are
471469
472470```julia
473471[0:n÷2;] * fs/n # if n is even
0 commit comments