00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
#ifndef _VrINTERPOLATINGSIGPROCNOWORK_H_
00044
#define _VrINTERPOLATINGSIGPROCNOWORK_H_
00045
00046
#include <VrHistoryProc.h>
00047
00048
template<
class iType,
class oType>
00049 class VrInterpolatingSigProcNoWork :
public VrHistoryProc<iType,oType> {
00050
00051
protected:
00052 int interp;
00053
00054
public:
00055
virtual int forecast(
VrSampleRange output,
00056
VrSampleRange inputs[]);
00057
00058
virtual void pre_initialize ();
00059
00060 VrInterpolatingSigProcNoWork() : interp(1) {}
00061
00062 VrInterpolatingSigProcNoWork(
int outputs) :
00063
VrHistoryProc<
iType,
oType>(outputs),
00064 interp(1) {}
00065
00066 VrInterpolatingSigProcNoWork(
int outputs,
int i) :
00067
VrHistoryProc<
iType,
oType>(outputs),
00068 interp(i) {}
00069
00070 virtual ~VrInterpolatingSigProcNoWork() {}
00071
00072 };
00073
00074
template<
class iType,
class oType>
int
00075 VrInterpolatingSigProcNoWork<iType,oType>::forecast(
VrSampleRange output,
00076
VrSampleRange inputs[]) {
00077
00078
00079
00080
00081
00082
00083 assert ((output.
size %
interp) == 0);
00084
00085
for(
unsigned int i=0;i<numberInputs;i++) {
00086 inputs[i].
index=output.
index/
interp;
00087 inputs[i].
size=output.
size/
interp + history-1;
00088 }
00089
return 0;
00090 }
00091
00092
00093
template<
class iType,
class oType>
void
00094 VrInterpolatingSigProcNoWork<iType,oType>::pre_initialize ()
00095 {
00096 assert (
interp >= 1);
00097
if (
interp == 1){
00098 fprintf (stderr,
"### Warning: interp == 1 in pre_initialize of %s. Are you sure?\n",
00099 name ());
00100 }
00101
if (
getSamplingFrequency () == 0.0)
00102
setSamplingFrequency (getInputSamplingFrequencyN (0) *
interp);
00103
00104
setOutputSize(interp);
00105 }
00106
00107
#endif