Skip to content

Commit

Permalink
Sanity check window length and FFT length
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanntg committed Jan 5, 2016
1 parent 92cf10d commit 110c414
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SyllableDetector/CircularShortTimeFourierTransform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class CircularShortTimeFourierTransform
guard v.isPowerOfTwo() else {
fatalError("The FFT size must be a power of 2.")
}

guard lengthWindow <= v else {
fatalError("The FFT size must be greater than or equal to the window length.")
}

lengthFft = v
fftSize = vDSP_Length(ceil(log2(CDouble(v))))
}
Expand Down

0 comments on commit 110c414

Please sign in to comment.