I need to remove the DC part of a signal. To do this I have this code:
def removeDC(seq):
mean_seq = np.mean(seq)
seq_mod = np.array([])
for sample in seq:
seq_mod = np.append(seq_mod,sample - mean_seq)
return seq_mod
But my data has the dimensions/shape of (31250, 5), and i want it to remove DC form every channel. This is my try to do this, but im not sure how i add the correct value to the correct channel index
def removeDC(seq): #removing dc from signal, slik at amplituden varierer rundt 0
for i in range(0,seq.shape[1])):
mean_seq = np.mean(seq[:,i])
seq_mod = np.array([]) #need seq.shape[1] dimensions, problem here
for sample in seq[:,i]: #problem here
seq_mod[,i] = np.append(seq_mod, sample - mean_seq)#problem here
return seq_mod