필터 지우기
필터 지우기

Hamming window around a specific frequency

조회 수: 5 (최근 30일)
Sebsatien
Sebsatien 2016년 3월 3일
답변: Star Strider 2016년 3월 3일
Hello
So, I'm in need of a little help concerning the hamming windowing of a signal. In fact, I realised the windowing, but it's over the full length of the signal, which doesn't suit my needs.
Instead, I need the window to be specifically around a selected frequency, let's say 50 Hz for instance, to denoise my signal and accentuate the frequency in question. The problem is that I can't manage to specify the length of the window so that it's set around a desired frequency. Especially when I'm windowing the signal in time domain (so introducing a frequency is not so obvious) and realise the FFT of the convoluted signal afterwards.
Here's the code :
clear all ;
close all ;
clc ;
n1 = 1000;
Fe = 12000;
t = (0:n1-1)/Fe;
sig = sin(2*pi*50*t) ;
L = length (sig);
nfft = 2^nextpow2(L);
s_Hamming = s2.*hamming(L);
Sfft_Hamming = fft(s_Hamming,nfft)/L;
mYdft = (Sfft_Hamming);
mYdft = mYdft (1:nfft/2+1);
mYdft (2:end-1) = 2*mYdft(2:end-1);
f = Fe/2*linspace(0,1,nfft/2+1);
figure
plot(f,mYdft)
grid on
title('Spectre avec fenètre de Hamming ');
xlabel('Frequence');
ylabel('Amplitude');
Thank you for any kind of help.

답변 (1개)

Star Strider
Star Strider 2016년 3월 3일
MathWorks already did this for you!
See: Remove the 60 Hz Hum from a Signal. Just make the change from 60 Hz to 50 Hz and you have the filter you want.

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by