Fix edge case
This commit is contained in:
parent
9f8710c6aa
commit
4c322603d3
1 changed files with 2 additions and 2 deletions
|
@ -74,7 +74,7 @@ class Signal:
|
||||||
start = min(self.x)
|
start = min(self.x)
|
||||||
if end is None:
|
if end is None:
|
||||||
end = max(self.x)
|
end = max(self.x)
|
||||||
indexes = where(logical_and(self.x > start, self.x < end))
|
indexes = where(logical_and(self.x >= start, self.x <= end))
|
||||||
return Signal(
|
return Signal(
|
||||||
self.x[indexes],
|
self.x[indexes],
|
||||||
self.y[indexes],
|
self.y[indexes],
|
||||||
|
@ -120,7 +120,7 @@ class Signal:
|
||||||
end = max(abs(freq_x))
|
end = max(abs(freq_x))
|
||||||
|
|
||||||
index_to_remove = where(
|
index_to_remove = where(
|
||||||
logical_and(abs(freq_x) < start, abs(freq_x) > end)
|
logical_and(abs(freq_x) <= start, abs(freq_x) >= end)
|
||||||
)
|
)
|
||||||
freq_y[index_to_remove] = 0
|
freq_y[index_to_remove] = 0
|
||||||
y = irfft(freq_y)
|
y = irfft(freq_y)
|
||||||
|
|
Loading…
Reference in a new issue