Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
Implemented high-pass Cauer schematic calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed May 5, 2014
1 parent fbb7ae4 commit 34cc29e
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion schcauer.cpp
Expand Up @@ -54,7 +54,45 @@ void SchCauer::calcLowPass()

void SchCauer::calcHighPass()
{
float R1,R2,R3,R4,R5,C1,C2;
float Wc = 2*M_PI*Fc;
float Nst = order/2 + order%2;
float Kv1 = pow(Kv,1.0/Nst);
//qDebug()<<Kv1;

for (int k=1; k <= order/2; k++) {

float re = Poles.at(k-1).real();
float im = Poles.at(k-1).imag();
float B = -2.0*re;
float C = re*re + im*im;
im = Zeros.at(k-1).imag();
float A = im*im;

qDebug()<<A<<B<<C;

C1 = 10.0/Fc;
C2 = C1;
R5 = 1.0/(Wc*C1);
R1 = (B*A*R5)/(Kv1*C);
R2 = (C*R5)/B;
R3 = B*R5;
R4 = Kv1*R5;

RC_elements curr_sec;
curr_sec.N = k;
curr_sec.R1 = 1000*R1;
curr_sec.R2 = 1000*R2;
curr_sec.R3 = 1000*R3;
curr_sec.R4 = 1000*R4;
curr_sec.R5 = 1000*R5;
curr_sec.C1 = C1;
curr_sec.C2 = C2;
Sections.append(curr_sec);

}

this->calcFirstOrder();
}


Expand All @@ -65,5 +103,5 @@ void SchCauer::createLowPassSchematic(QString &s)

void SchCauer::createHighPassSchematic(QString &s)
{

createLowPassSchematic(s);
}

0 comments on commit 34cc29e

Please sign in to comment.