mirror of
https://github.com/opencv/opencv.git
synced 2026-01-18 17:21:42 +01:00
Merge pull request #28182 from shahkarnav115-beep:samples-guard-stft-timestep
samples(python): guard against invalid STFT time step
This commit is contained in:
@@ -330,6 +330,10 @@ class AudioDrawing:
|
||||
"""
|
||||
|
||||
time_step = self.windLen - self.overlap
|
||||
if time_step <= 0:
|
||||
raise ValueError(
|
||||
"Invalid STFT parameters: overlap must be smaller than window length"
|
||||
)
|
||||
stft = []
|
||||
|
||||
if self.windowType == "Hann":
|
||||
@@ -801,4 +805,4 @@ if __name__ == "__main__":
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
AudioDrawing(args).Draw()
|
||||
AudioDrawing(args).Draw()
|
||||
Reference in New Issue
Block a user