Feb-02-2023, 04:12 PM
Hi my friend,
I am using Jupyter Notebook to handle my data. Now I have a csv file with 6 columns and 32768 rows, but I only need the 2nd, 5th and 6th columns and their first 4000 rows data. Here is my Matlab code:
clear
clc
close all
A=readmatrix('.\50clk.csv');
Time = A(2:32768,2);
I = A(2:32768,5)-mean(A(2:32768,5));
Q = A(2:32768,6)-mean(A(2:32768,6));
Q_BP = bandpass(Q,[15e3 25e3],Fs);
I_BP = bandpass(I,[15e3 25e3],Fs);
S =I_BP+1i*Q_BP;
phi_unwrap = unwrap(angle(S(1:4000)));
c = polyfit(Time(1:4000),phi_unwrap,1);
f_cal(1) = abs((c(1)/2/pi))
Can anyone help me to convert such code into python?
I am using Jupyter Notebook to handle my data. Now I have a csv file with 6 columns and 32768 rows, but I only need the 2nd, 5th and 6th columns and their first 4000 rows data. Here is my Matlab code:
clear
clc
close all
A=readmatrix('.\50clk.csv');
Time = A(2:32768,2);
I = A(2:32768,5)-mean(A(2:32768,5));
Q = A(2:32768,6)-mean(A(2:32768,6));
Q_BP = bandpass(Q,[15e3 25e3],Fs);
I_BP = bandpass(I,[15e3 25e3],Fs);
S =I_BP+1i*Q_BP;
phi_unwrap = unwrap(angle(S(1:4000)));
c = polyfit(Time(1:4000),phi_unwrap,1);
f_cal(1) = abs((c(1)/2/pi))
Can anyone help me to convert such code into python?