Python Forum

Full Version: signal anti-aliasing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I am reading signal from ADXL1005 with ADS1256 24bit ADC to Teens4.0.
I have sample rate 30000 and I read 30000 samples.
I have no problem with data from signal generator.
For example if I set 1000Hz sine and 0,06V = 1gRMS I see exact numbers:
https://pasteboard.co/3uWNlpoqWzei.jpg

and noise with 0V and 0Hz:
https://pasteboard.co/DMYVa1Xxjagr.jpg

BUT if I read data from Teensy, then I can see:
NOISE:
https://pasteboard.co/kdrMSJuSR9nQ.jpg

For low frequencies is it ok according proffessional analyzer:
https://pasteboard.co/jtMgNWaIlvzC.jpg

BUT for higher frequencies I can see nonsenses, for example two times lower values than on analyzer:
https://pasteboard.co/JAE8P6uAinH6.jpg

For time signal / wave I have this code:
def time_signal(self):           
        self.plot_signal = v_data
        lowcut = 10.0
        highcut = 14900.0
        self.plot_signal = butter_bandpass_filter(self.plot_signal, lowcut, highcut, SPS, order=4)
        x = np.linspace(start = 0, stop = 1, num = SAMPLES)
        self.canvas.axes.cla() 
        self.canvas.axes.set_ylabel("Amplitude in g")
        self.canvas.axes.set_xlabel("Time in seconds")   
        self.canvas.axes.plot(x, self.plot_signal[0:SAMPLES], 'b')
        self.canvas.draw()
        self.g_rms()
and for gRMS calculation:
def g_rms(self): 
        g_rms1 = v_data # data from Teensy - from generator OK, from ADXL low frequencies OK, high problem
        lowcut = 10.0
        highcut = 14900.0
        g_rms1 = butter_bandpass_filter(g_rms1, lowcut, highcut, SPS, order=4)
        peak_max = abs(max(g_rms1))
        peak_min = abs(min(g_rms1))
        g_rms1 = [np.power(x,2) for x in g_rms1]
        tot = sum(g_rms1)
        tot = celkem / SAMPLES
        tot = np.sqrt(tot)
        self.btn8.setText("g RMS: " + str(round(celkem,2)))              #gRMS 
        pp = peak_max + peak_min
        self.btn9.setText("g 0-peak: " + str(round(peak_max,2)))     # 0-peak 
        self.btn11.setText("g peak-peak: " + str(round(pp,2)))     # peak-peak
Any idea where should be the problem? Thank you!