ITAFiniteImpulseResponse.cpp 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <ITAFiniteImpulseResponse.h>

CITAFiniteImpulseResponse::CITAFiniteImpulseResponse()
	: m_dSampleRate( 0 )
{
}

CITAFiniteImpulseResponse::CITAFiniteImpulseResponse( const int iLength, const double dSampleRate, const bool bZeroInit /*= true */ )
	: ITASampleBuffer( iLength, bZeroInit )
	, m_dSampleRate( dSampleRate )
{
}

CITAFiniteImpulseResponse::CITAFiniteImpulseResponse( const CITAFiniteImpulseResponse* pSource )
{
	Init( pSource->GetLength(), pSource->GetSampleRate() );
	ITASampleBuffer::write( pSource, pSource->GetLength() );
}

CITAFiniteImpulseResponse::CITAFiniteImpulseResponse( const CITAFiniteImpulseResponse& sbSource )
{
	Init( sbSource.GetLength(), sbSource.GetSampleRate() );
	ITASampleBuffer::write( sbSource, sbSource.GetLength() );
}

26
27
28
29
30
31
void CITAFiniteImpulseResponse::Init( const int iLength, const double dSampleRate, const bool bZeroInit /*= true */ )
{
	m_dSampleRate = dSampleRate;
	ITASampleBuffer::Init( iLength, bZeroInit );
}

32
33
34
35
36
37
38
39
40
double CITAFiniteImpulseResponse::GetSampleRate() const
{
	return m_dSampleRate;
}

double CITAFiniteImpulseResponse::GetNyquistFrequency() const
{
	return GetSampleRate() / 2.0f;
}