Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "HighPassFilter.h"
- extern queue<unsigned char> in2HighPassQueue;
- extern concurrent_vector<short> highPass2ClipQueue;
- RetVal HighPassFilter(float alpha)
- {
- // input data
- static short xCurr = 0;
- static short xPrev = 0;
- // output data
- static short yCurr = 0;
- static short yPrev = 0;
- // filterring
- while(!in2HighPassQueue.empty())
- {
- xPrev = xCurr;
- xCurr = in2HighPassQueue.front();
- in2HighPassQueue.pop();
- yPrev = yCurr;
- yCurr = alpha * (yPrev + xCurr - xPrev);
- highPass2ClipQueue.push_back(yCurr);
- }
- return RET_OK;
- }
- --------------------------------------------------------
- #ifndef _HIGH_PASS_FILTER_H_
- #define _HIGH_PASS_FILTER_H_
- #include <queue>
- #include "tbb/concurrent_vector.h"
- #include "defines.h"
- using namespace std;
- using namespace tbb;
- RetVal HighPassFilter(float alpha);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement