Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 93772c7

Browse files
committed
Plot filter frequency response with logarithmic scale in the frequency axis; increased default number of frequency points.
1 parent c2687d9 commit 93772c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

biosppy/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
MAX_ROWS = 10
3434

3535

36-
def _plot_filter(b, a, sampling_rate=1000., nfreqs=512, ax=None):
36+
def _plot_filter(b, a, sampling_rate=1000., nfreqs=4096, ax=None):
3737
"""Compute and plot the frequency response of a digital filter.
3838
3939
Parameters
@@ -70,7 +70,7 @@ def _plot_filter(b, a, sampling_rate=1000., nfreqs=512, ax=None):
7070

7171
# amplitude
7272
pwr = 20. * np.log10(np.abs(resp))
73-
ax.plot(freqs, pwr, 'b', linewidth=MAJOR_LW)
73+
ax.semilogx(freqs, pwr, 'b', linewidth=MAJOR_LW)
7474
ax.set_ylabel('Amplitude (dB)', color='b')
7575
ax.set_xlabel('Frequency (Hz)')
7676

biosppy/signals/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _filter_signal(b, a, signal, zi=None, check_phase=True, **kwargs):
136136
return filtered, zf
137137

138138

139-
def _filter_resp(b, a, sampling_rate=1000., nfreqs=512):
139+
def _filter_resp(b, a, sampling_rate=1000., nfreqs=4096):
140140
"""Compute the filter frequency response.
141141
142142
Parameters

0 commit comments

Comments
 (0)