Skip to content

Commit b219cf5

Browse files
committed
Updates frequency test and adds torchaudio as a dependency
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent cafc1fe commit b219cf5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

monai/transforms/signal/array.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,11 @@ def __call__(self, signal: np.ndarray) -> Any:
411411
Args:
412412
signal: signal to be frequency removed
413413
"""
414+
signal = convert_to_tensor(signal, dtype=torch.double)
414415
b_notch, a_notch = convert_to_tensor(
415-
iirnotch(self.frequency, self.quality_factor, self.sampling_freq), dtype=torch.float
416+
iirnotch(self.frequency, self.quality_factor, self.sampling_freq), dtype=torch.double
416417
)
417-
y_notched = filtfilt(convert_to_tensor(signal), a_notch, b_notch)
418+
y_notched = filtfilt(signal, a_notch, b_notch)
418419

419420
return y_notched
420421

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Full requirements for developments
22
-r requirements-min.txt
33
pytorch-ignite==0.4.11
4+
torchaudio
45
gdown>=4.7.3
56
scipy>=1.12.0; python_version >= '3.9'
67
itk>=5.2

0 commit comments

Comments
 (0)