Skip to content

Commit

Permalink
incre
Browse files Browse the repository at this point in the history
  • Loading branch information
peads committed Jul 29, 2024
1 parent f7c527e commit 76f5b94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/dsp/demodulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def imagOutput(data: ndarray[any, dtype[complexfloating]], res: ndarray[any, dty
res[:] = imag(data)


# @njit(cache=True, nogil=True, error_model='numpy', boundscheck=False, parallel=True)
@guvectorize([(complex128[:], complex128[:, :], complex128[:, :])], '(n),(m,n)->(m,n)',
nopython=True,
cache=True,
Expand All @@ -65,10 +64,4 @@ def imagOutput(data: ndarray[any, dtype[complexfloating]], res: ndarray[any, dty
def shiftFreq(y: ndarray[any, dtype[complexfloating]],
shift: ndarray[any, dtype[complexfloating]],
res: ndarray[any, dtype[complexfloating]]) -> None:
"""
NOTE: apparently, numpy doesn't override the unary multiplication arithemetic assignment operator the
same way as the binary multiplication operator for ndarrays. So, this has to remain this way.
"""
res[:, :] = y * shift
# for i in range(y.shape[0]):
# res[i] = y[i] * shift[i]
4 changes: 2 additions & 2 deletions test/dsp/dsp_processor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def test_init(processor):
processor.centerFreq = DEFAULT_CENTER
assert processor.centerFreq == DEFAULT_CENTER
processor._generateShift(DEFAULT_SHIFT_SIZE)
assert len(processor._shift) == DEFAULT_SHIFT_SIZE
assert processor._shift.size == DEFAULT_SHIFT_SIZE
for k in range(8):
assert processor._shift[k] == np.pow(math.e, -2j * math.pi * (DEFAULT_CENTER / DEFAULT_FS) * k)
assert processor._shift[0][k] == np.pow(math.e, -2j * math.pi * (DEFAULT_CENTER / DEFAULT_FS) * k)

with pytest.raises(FileNotFoundError) as e:
processor.processData(None, None, '')
Expand Down

0 comments on commit 76f5b94

Please sign in to comment.