Commit 67aa5b32 authored by Raymond Toy's avatar Raymond Toy
Browse files

Add consistency check for sizes in inverse-rfft

Check that the length of the array is consistent with the given n (fft
length).  This isn't perfect.  Real FFTs of size 4 and 5 both produce
transformed arrays of length 3, and there's no way to tell which is
correct.
parent e090c4d8
......@@ -111,6 +111,15 @@
See RFFT for the definition of the FFT used in these routines."
(declare (type (simple-array (complex single-float) (*)) x))
;; Check to see if N is consistent with the length of X. However,
;; this isn't foolproof. For a real FFT of length 5, the FFT array
;; has length 3. But a real FFT of length 4 also has an array
;; length of 3.
(unless (= (length x) (1+ (floor n 2)))
(error "Length of X (~A) is not compatible with N (~D)"
(length x) n))
(let* ((inv (convert-inverse-rfft x n))
(work (make-array n :element-type 'single-float))
(wsave (get-wsave-entry n))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment