qm-dsp 1.8
Decimator.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2/*
3 QM DSP Library
4
5 Centre for Digital Music, Queen Mary, University of London.
6 This file 2005-2006 Christian Landone.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
13*/
14
15#ifndef DECIMATOR_H
16#define DECIMATOR_H
17
25{
26public:
37 Decimator( unsigned int inLength, unsigned int decFactor );
38 virtual ~Decimator();
39
46 void process( const double* src, double* dst );
47
54 void process( const float* src, float* dst );
55
56 int getFactor() const { return m_decFactor; }
57 static int getHighestSupportedFactor() { return 8; }
58
59 void resetFilter();
60
61private:
62 void deInitialise();
63 void initialise( unsigned int inLength, unsigned int decFactor );
64 void doAntiAlias( const double* src, double* dst, unsigned int length );
65 void doAntiAlias( const float* src, double* dst, unsigned int length );
66
67 unsigned int m_inputLength;
68 unsigned int m_outputLength;
69 unsigned int m_decFactor;
70
71 double Input;
72 double Output ;
73
74 double o1,o2,o3,o4,o5,o6,o7;
75
76 double a[ 9 ];
77 double b[ 9 ];
78
79 double* decBuffer;
80};
81
82#endif //
Decimator carries out a fast downsample by a power-of-two factor.
Definition Decimator.h:25
void initialise(unsigned int inLength, unsigned int decFactor)
Definition Decimator.cpp:39
double o1
Definition Decimator.h:74
double b[9]
Definition Decimator.h:77
void deInitialise()
unsigned int m_inputLength
Definition Decimator.h:67
void resetFilter()
double o2
Definition Decimator.h:74
double o3
Definition Decimator.h:74
static int getHighestSupportedFactor()
Definition Decimator.h:57
double a[9]
Definition Decimator.h:76
double Input
Definition Decimator.h:71
double o4
Definition Decimator.h:74
double * decBuffer
Definition Decimator.h:79
double Output
Definition Decimator.h:72
void doAntiAlias(const double *src, double *dst, unsigned int length)
double o7
Definition Decimator.h:74
virtual ~Decimator()
Definition Decimator.cpp:34
int getFactor() const
Definition Decimator.h:56
void process(const double *src, double *dst)
Process inLength samples (as supplied to constructor) from src and write inLength / decFactor samples...
double o5
Definition Decimator.h:74
double o6
Definition Decimator.h:74
unsigned int m_decFactor
Definition Decimator.h:69
unsigned int m_outputLength
Definition Decimator.h:68