Click here to Skip to main content
15,895,667 members
Articles / Programming Languages / C++

ECG recording, storing, filtering and recognition

Rate me:
Please Sign up or sign in to vote.
4.72/5 (110 votes)
14 Apr 200411 min read 734.5K   38.4K   156  
Full open code project for making driver and application software for ECG medical measurements.
// DSP_Filter.h: interface for the DSP_Filter class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DSP_FILTER_H__2649F000_8C49_11D7_8A9A_DF0DA3FB6A79__INCLUDED_)
#define AFX_DSP_FILTER_H__2649F000_8C49_11D7_8A9A_DF0DA3FB6A79__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class DSP_Filter  
{
public:
	void Amplifier(double* dest,double* source,int lenght,double ampl);
	double FindMin(double* source,int lenght);
	double FindMax(double* source,int lenght);
	void WFilter_Low40Hz(double*dest,double*source,int lenght,int fsmpl,double cf);

	void WFilter_Noht(double* dest,double* source,int lenght,int fsmpl,double cf);
	void WFilter_Low100Hz(double* dest,double* source,int lenght,int fsmpl,double cf);
	void LoadFilterKernels(int fsmpl);
	
	void Message(double var);
	double StandardDeviation(double* source,int lenght);
	void Delta1(double* dest,double* source,int lenght);
	void Delta2(double* dest,double* source,int lenght);
	void DeltaReverse1(double* dest,double* source,int lenght);
	void DeltaReverse2(double* dest,double* source,int lenght);
	
	double Mean(double *source, int lenght);
	void SetArrToNormalize(double *dest,int lenght);
	void NormalizeArr(double *ar, double mean, int lenght);
	
	void InvertArr(double* dest,double* source,int lenght);
	void WFilter_High(double* dest,double* source,int lenght,double amp,int fsmpl,double fk);
	void RFilter_Noht(double* dest,int lenght,int fsmpl,double fcut,double bw);
	double* X;
	double* Y;
	void RFilter_Low(double* dest,int lenght,int fsmpl,double fk);
	DSP_Filter();
	virtual ~DSP_Filter();

private:

	int CreateWF40Low(int fsmpl,int f_kernel);
	int CreateWFLow(int fsmpl,int f_kernel);
	int CreateWFHigh(int fsmpl,int f_kernel);
	int CreateWF50Noht(int fsmpl,int f_kernel);

	double L40HZ[100];
	double H[200];
	double L[100];
	double B1[100];
	double B2[100];

	void SlideArrRight(double* dest,double* source,int lenght,int slide);
	void SlideArrLeft(double* dest,double* source,int lenght,int slide);
	
	bool b_arr_flag;
	void Delete_Arrs();
	void Greate_Arrs(int new_lenght);
	double PI;
	void MoveArr(double* dest,double* source, int lenght);
	void ZeroArrs(int lenght);
};

#endif // !defined(AFX_DSP_FILTER_H__2649F000_8C49_11D7_8A9A_DF0DA3FB6A79__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Systems Engineer
Bulgaria Bulgaria
PhD, Cum Laude in digital automation systems
M.S. in Telemommunication management
B.S. in Telecommunication systems engineering
Programming: CUDA, C/C++, VHDL
Software and Hardware development and consulting:
data acquisition, image processing, medical instrumentation

Comments and Discussions