Skip to content

Commit

Permalink
Use np.linspace() where appropriate
Browse files Browse the repository at this point in the history
Fixes #46
  • Loading branch information
mhostetter committed Jul 27, 2023
1 parent bf65fb7 commit f063e7f
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 47 deletions.
33 changes: 17 additions & 16 deletions docs/examples/farrow-resampler.ipynb

Large diffs are not rendered by default.

74 changes: 63 additions & 11 deletions docs/examples/phase-locked-loop.ipynb

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions docs/examples/psk.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/sdr/_modulation/_symbol_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def binary_code(n: int) -> np.ndarray:
if not n >= 1:
raise ValueError(f"Argument 'n' must be greater than or equal to 1, not {n}.")

return np.arange(0, 2**n)
return np.arange(2**n)


@export
Expand Down
4 changes: 2 additions & 2 deletions tests/resamplers/test_farrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
def generate_signal():
N = 1_000 # samples
omega = 2 * np.pi / 40 # radians
x = np.exp(1j * omega * np.arange(0, N)) # Complex exponential input signal
x = np.exp(1j * omega * np.arange(N)) # Complex exponential input signal
x *= np.exp(-np.arange(N) / 300) # Exponential decay
tx = np.arange(0, N) # Time axis for the input signal
tx = np.arange(N) # Time axis for the input signal
return tx, x


Expand Down

0 comments on commit f063e7f

Please sign in to comment.