Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Implementing LowPass Filter in Java (Android) - QRS detection

Status
Not open for further replies.

ltv

Newbie level 2
Joined
Dec 28, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
11
hi there,

I am trying to learn both: DSP and programming in Android. But I stuck at beginning of my project.

I have a transfer function:
\[H(z) = \frac{1}{32} \frac{(1-z^{-6})^{2}}{(1-z^{-1})^{2}}\]
\[ y(nT) = 2y(nT - T) - y(nT - 2T) + x(nT) - 2x(nT - 6T) + x(nT - 12T)\]

and I don't know how to implement it in java.

1) How can I deal with delay?
2) Do I have to put to my function all my raw data? Cuz if I want to work someday on data from bluetooth I guess this will be impossible

Yeah, I know. I don't understand basic stuff. But i really want to learn.

I found on wikipedia a simple code:
Code:
for i from 1 to n
  y[i] := y[i-1] + α * (x[i] - y[i-1])
but there is nothing about a transfer function which I should use (I am trying to implement Pan-Tompkins algorithm)

Could someone please show me the way? Whatever? I will be grateful.

Best regards,
Kate
 

You have already written the difference equation representing your z-domain transfer function. It can be directly translated to C- or Java code.

There are tons of web sites discussing digital filter implementation in Java, just as Google.
 

could you just tell me what should be my input (arguments of function) and output (returned value)?
should I put to function all my ArrayList?
 

The filter function would input x and return y, both actual values. And there will arrays to store previous values of x (12) and y (2), implemented e.g. as class variables.

The filter function is called once per sample.
 

You have already written the difference equation representing your z-domain transfer function. It can be directly translated to C- or Java code.

Could you break down the process of converting the Z domain transfer function into it's equivalent code?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top