Python Forum
Problem In calling a Function from another python file of project
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem In calling a Function from another python file of project
#3
I am posting my digital filter code below:
from scipy import signal
from EEG import eeg_data
import array as arr


sample_rate = 250
nyquist_rate = sample_rate/2

gMax_Blocks = 32
gMax_Samples = 8
gMax_Channel = 4

# Cofficient for IIR filters
b2 = arr.array('d',[0.965080986344733, -0.242468320175764, 1.94539149412878, -0.242468320175764, 0.965080986344733])
a2 = arr.array('d',[1, -0.246778261129785, 1.94417178469135, -0.238158379221743, 0.931381682126902])
b = arr.array('d',[0.200138725658073, 0, -0.400277451316145, 0, 0.200138725658073])
a = arr.array('d',[1, -2.35593463113158, 1.94125708865521, -0.784706375533419, 0.199907605296834])



def apply_filter():
    fc = 0.5  # Cut-off frequency of the filter
    w = fc / (sample_rate / 2)  # Normalize the frequency
    b, a = signal.butter(2, w, 'high')
    for  line in eeg_data:
        output = arr.arry('d',[signal.filtfilt(b, a, line)])
Reply


Messages In This Thread
RE: Problem In calling a Function from another python file of project - by vinod2810 - Sep-26-2019, 05:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] remove file from current project rwahdan 2 2,340 Jul-25-2021, 09:14 AM
Last Post: Larz60+
  python file(.py) not working with my tkinter project DeanAseraf1 9 7,316 Mar-22-2020, 10:58 PM
Last Post: ifigazsi
  [Tkinter] Issue with calling a Class/Method in GUI File Fre3k 3 3,070 Mar-08-2020, 12:35 PM
Last Post: Fre3k
  Calling widget from another function? WuchaDoin 1 3,667 Oct-23-2018, 12:55 AM
Last Post: stullis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020