Windowing a signal in frequency space

AI Thread Summary
The discussion focuses on a Python script designed to process a noisy multi-frequency signal by transforming it to frequency space, applying a Gaussian window, and then transforming it back to time space. The user encounters an issue where the resulting windowed signal contains significant imaginary components, which are comparable to the real parts. This problem arises because applying the Gaussian window alters the symmetry of the signal's spectrum, leading to a complex signal. The conversation highlights the importance of understanding the implications of windowing in frequency space and suggests that the user needs to correctly filter the signal to address the issue. Ultimately, the challenge lies in managing the transformation and filtering process to maintain the integrity of the signal.
mdornfe1
Messages
3
Reaction score
0
I'm not sure if this is the right place to post this, but I'm trying to write a python script that takes a noisy multi frequency signal, transforms it to frequency space, windows it there with a gaussian, then transforms it back to time space. Here is what I wrote:

Code:
Fs=1000     #sampling frequency
fo=120      #center of gaussian   
sigma=0.01  #inverse width of gaussian
T=1./Fs
L=2**10     #number of samples
t=arange(0,L)*T #time vector
f=fftfreq(L,T)    #frequency vector
x=0.7*sin(2*pi*50*t) + sin(2*pi*120*t)+randn(t.size)/sqrt(t.size)   #signal
x_fft=fft(x)
W=exp(-square(2*pi*sigma*(f-fo)))   #gaussian window
y=ifft(W*x_fft)                      #windowed signal

The problem I'm running into is the windowed signal y has non negligible imaginary parts. They're about the same order as the real parts. Does anyone know why I might be getting this?
 
Engineering news on Phys.org
MATLAB fft returns the signal spectrum both for positive and negative frequencies. Of course in your case the signal is real so its spectrum is symmetric under conjugation.
When you multiplied by a window, you eliminated the negative frequencies of the signal, thus transforming it to a complex signal (its spectrum is no longer symmetric).
For a L-point DFT (suppose L is even), the indices 1:L/2 in the vector correspond to the frequencies [0,pi), and the indices (L/2+1):L correspond to the frequencies [-pi,0) (in the same order).
I'll leave it up to you to figure out how to correctly filter the signal with the Gaussian window.
 
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I have recently moved into a new (rather ancient) house and had a few trips of my Residual Current breaker. I dug out my old Socket tester which tell me the three pins are correct. But then the Red warning light tells me my socket(s) fail the loop test. I never had this before but my last house had an overhead supply with no Earth from the company. The tester said "get this checked" and the man said the (high but not ridiculous) earth resistance was acceptable. I stuck a new copper earth...
Thread 'Electromagnet magnetic field issue'
Hi Guys We are a bunch a mechanical engineers trying to build a simple electromagnet. Our design is based on a very similar magnet. However, our version is about 10 times less magnetic and we are wondering why. Our coil has exactly same length, same number of layers and turns. What is possibly wrong? PIN and bracket are made of iron and are in electrical contact, exactly like the reference design. Any help will be appreciated. Thanks. edit: even same wire diameter and coil was wounded by a...

Similar threads

Replies
2
Views
2K
Replies
10
Views
3K
Replies
1
Views
2K
Replies
8
Views
2K
Replies
3
Views
1K
Back
Top