Documentation
¶
Index ¶
- type FIR
- type SincFilter
- func (f *SincFilter) Highpass(input []float64) ([]float64, error)
- func (f *SincFilter) HighpassResponse() *freqresponse.FreqResponse
- func (f *SincFilter) Lowpass(input []float64) ([]float64, error)
- func (f *SincFilter) LowpassResponse() *freqresponse.FreqResponse
- func (f *SincFilter) SampleRate() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FIR ¶
type FIR struct {
// contains filtered or unexported fields
}
FIR (Finite Impulse Response) filter
func (*FIR) Convolve ¶
Convolve the given input data with the filter kernel. Returns non-nil error if input size not be greater than the filter kernel size.
func (*FIR) FreqResponse ¶
func (fir *FIR) FreqResponse(srate float64) *freqresponse.FreqResponse
FreqResponse calculates the filter frequency response.
type SincFilter ¶
type SincFilter struct {
// contains filtered or unexported fields
}
SincFilter is windowed FIR filter that implements lowpass and highpass. A bandpass and bandstop filter would be implemented using two of these. Theoretical source: http://www.labbookpages.co.uk/audio/firWindowing.html
func NewSincFilter ¶
func NewSincFilter(srate, cutoff float64, order int, w window.WindowMaker) (*SincFilter, error)
NewSincFilter makes a new FIR filter that can be used for highpass and lowpass filtering.
func (*SincFilter) Highpass ¶
func (f *SincFilter) Highpass(input []float64) ([]float64, error)
Highpass processes the input with the highpass FIR.
func (*SincFilter) HighpassResponse ¶
func (f *SincFilter) HighpassResponse() *freqresponse.FreqResponse
HighpassResponse returns the frequency response of the highpass FIR.
func (*SincFilter) Lowpass ¶
func (f *SincFilter) Lowpass(input []float64) ([]float64, error)
Lowpass processes the input with the lowpass FIR.
func (*SincFilter) LowpassResponse ¶
func (f *SincFilter) LowpassResponse() *freqresponse.FreqResponse
LowpassResponse returns the frequency response of the lowpass FIR.
func (*SincFilter) SampleRate ¶
func (f *SincFilter) SampleRate() float64
SampleRate returns the sample rate that the filter was designed with.