I have a time series of measurements which I want to high pass with Butterworth filter.
Python scipy package has a built in function for Butterworth filter (signal.butter) and I know how to apply it to the data in the time domain.
Let's say that x is my data with sampling frequency fs and a vector of time stamps t. I computed the power spectrum in the following way:
import scipy
import numpy as np
n = len(t)
xhat = scipy.fft.fft(x,n)
PSD = xhat * np.conj(xhat)/n
My question is if I transform my time series to the frequency domain, how do I apply the Butterworth filter in the frequency domain at cutoff frequency fC?
I am looking for an answer preferably in Python but I am also just generally interested in an answer such as formulas or steps explained in words.