import dascore as dc
= dc.examples.sin_wave_patch(
patch =1000,
sample_rate=[200, 10],
frequency=2,
channel_count
)= patch.viz.wiggle(show=True) _
Processing
The following shows some simple examples of patch processing. See the proc module documentation for a list of processing functions.
Decimate
The decimate patch function decimates a Patch
along a given axis while by default performing low-pass filtering to avoid aliasing.
Data creation
First, we create a patch composed of two sine waves; one above the new decimation frequency and one below.
IIR filter
Next we decimate by 10x using IIR filter
= patch.decimate(time=10, filter_type='iir')
decimated_iir = decimated_iir.viz.wiggle(show=True) _
Notice the lowpass filter removed the 200 Hz signal and only the 10Hz wave remains.
FIR filter
Next we decimate by 10x using FIR filter.
= patch.decimate(time=10, filter_type='fir')
decimated_fir = decimated_fir.viz.wiggle(show=True) _
No Filter
Next, we decimate without a filter to purposely induce aliasing.
= patch.decimate(time=10, filter_type=None)
decimated_no_filt = decimated_no_filt.viz.wiggle(show=True) _