Skip to content

Commit

Permalink
Replace nyq argument with fs in firwin calls (#44)
Browse files Browse the repository at this point in the history
The Nyquist frequency (`nyq`) argument has been deprecated since Scipy
version 1.0.0 and removed in version 1.12.0. Sampling frequency (`fs`)
should be provided instead.
  • Loading branch information
ghykk authored Sep 10, 2024
1 parent c71b455 commit fbf30b3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion content-es/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Y aunque todavía no hemos entrado en el diseño del filtro, aquí está el cód
sample_rate = 32000 # Hz
# create our low pass filter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# plot the impulse response
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion content-fr/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Et même si nous n'avons pas encore abordé la conception des filtres, voici le
sample_rate = 32000 # Hz
# créer notre filtre passe-bas
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# tracer la réponse impulsionnelle
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion content-nl/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Ook al hebben we nog niets geleerd over filterontwerp, hieronder kun je de code
sample_rate = 32000 # Hz
# laag-doorlaatfilter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# impulsrespons weergeven
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion content-ukraine/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Example Use-Case
sample_rate = 32000 # Hz
# create our low pass filter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# plot the impulse response
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion content-zh/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Example Use-Case
sample_rate = 32000 # Hz
# create our low pass filter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# plot the impulse response
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion content/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ And even though we haven't gotten into filter design yet, here is the Python cod
sample_rate = 32000 # Hz
# create our low pass filter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate/2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)
# plot the impulse response
plt.plot(h, '.-')
Expand Down
2 changes: 1 addition & 1 deletion figure-generating-scripts/filters_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sample_rate = 32000 # Hz

# create our low pass filter
h = signal.firwin(num_taps, cut_off, nyq=sample_rate / 2)
h = signal.firwin(num_taps, cut_off, fs=sample_rate)

# plot the impulse response
plt.plot(h, '.-')
Expand Down

0 comments on commit fbf30b3

Please sign in to comment.