GrLimiter.h
Go to the documentation of this file.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
#ifndef _GRLIMITER_H_
00032
#define _GRLIMITER_H_
00033
00034
#include <VrSigProc.h>
00035
00036
template<
class iType,
class oType>
00037 class GrLimiter :
public VrSigProc {
00038
00039
public:
00040 virtual const char *
name() {
return "GrLimiter"; }
00041
virtual int work(
VrSampleRange output,
void *o[],
00042
VrSampleRange inputs[],
void *i[]);
00043
GrLimiter();
00044 };
00045
00046
template<
class iType,
class oType>
int
00047 GrLimiter<iType,oType>::work(
VrSampleRange output,
void *ao[],
00048
VrSampleRange inputs[],
void *ai[])
00049 {
00050
iType **i = (
iType **)ai;
00051
oType **o = (
oType **)ao;
00052
iType *ip = i[0];
00053
oType *op = o[0];
00054
00055
int size = output.
size;
00056
00057
while(size-- > 0)
00058 *op++ = *ip++>0?1:-1;
00059
return output.
size;
00060 }
00061
00062
template<
class iType,
class oType>
00063 GrLimiter<iType,oType>::GrLimiter()
00064 :
VrSigProc(1, sizeof(
iType), sizeof(
oType))
00065 {
00066
setOutputSize (1024);
00067 }
00068
00069
#endif
Generated on Wed Aug 4 02:22:04 2004 for GNU Radio by
1.3.8