Zeroing out particular frequency in audio signal

47 Ansichten (letzte 30 Tage)
Alex Z
Alex Z am 30 Sep. 2019
Kommentiert: Kulbir Kaur am 31 Mai 2020
Hello, would appreciate a clarification on the following:
I have certain audio recording, several seconds in duration, fs = 44.1kHz
This is actually environmental noise of particular environment, the goal is to figure out main noise frequency component (or 2-3 components), filter them out and reconstruct the signal back for playback without these main noise components.
Just to get the feel of that, I'm trying to achieve that by figuring the highest magnitude peak after FFT (or 2 highest magnitude components), zeroing them out in frequency domain (just setting the appropriate FFT vector components and their conjugate pairs to zero) and then duing IFFT of the result. Then playing back the resulting vector using "sound(signal_vector, Fs)".
I'm checking the spectrum of the original signal and after zeroing out the 2 highest magnitude components - indeed the processed spectrum has those components zeroed out. However, playing the IFFT resulting signal it sounds the same as the original one. Can hear no any effect of the zeroing.
Hence the questions:
  1. Is the approach of zeroing out in frequency domain and than inverse FFT - wrong one for the goal I'm trying to achieve ? If so, will appreciate explanation
  2. If this approach should work, what to check to figure out the reason the reproduced audio sounds juts like the original one ?
Thank you in advance
Alex
  2 Kommentare
Kulbir Kaur
Kulbir Kaur am 31 Mai 2020
can you please share the matlab code of this?
Kulbir Kaur
Kulbir Kaur am 31 Mai 2020
After identifying the highest peaks how are you zeroing them from the contaminated signal?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Alex Z
Alex Z am 30 Sep. 2019
Thank you Dimitris In fact, I ran FFT on the entire vector of the input signal (around 300000 samples at sampling rate of 44.1kHz) I’ll try to zero out the area around the peak highest magnitude peaks What does mean the highest energy can be hidden ? If I see clear peaks in the spectrum that 3-4 times higher in magnitude than average spectrum magnitude - isn’t that clear sign of the frequency containing highest energy ?
  1 Kommentar
Dimitris Kalogiros
Dimitris Kalogiros am 30 Sep. 2019
Performing FFT transform on a signal, only a set of specific frequencies are being revealed. If we have a N-points FFT on a signal, sampled with Fs , then we can observe what is happening only on Fs/N frequency points.
So, if Fs is relativly high and N relativly small, then we miss what is happening between these Fs/N frequency points.
You can see what I am saying, by runing the following code:
clc; clearvars
% sampling frequency
Fs=10;
t=0:1/Fs:127*(1/Fs);
% two sinousoidals and a "noise" signal
f1=0.2;
x1=sin(2*pi*f1.*t);
f2=0.55;
x2=sin(2*pi*f2.*t);
noiseAmplitude=2;
x3=noiseAmplitude*randn(size(t));
figure;
subplot(3,1,1); plot(t,x1);
subplot(3,1,2); plot(t,x2);
subplot(3,1,3); plot(t,x3);
x=x1+x2+x3;
% FFT
y=fft(x);
figure; plot(abs(y),'-r.');
Begin with noiseAmplitude=0 and increase it, up to 3
With noiseAmplitude=0, change slightly values of f1 and f2 , and look how it affects the spikes of the sinousoidals.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Dimitris Kalogiros
Dimitris Kalogiros am 30 Sep. 2019
I'm giving you some tips:
1) Use high order FFT/IFFT . For example 8192 or even higher.
2) You have to filter out (by setting them to 0), not only the highest sample (samples) , but a neighborhood around the highest. For example an interval of 1% of FFT length.
3) How "the highest magnitude sample" is defined ? Sometimes the true highest sample is hidden. A usefull method here is to pass the abs(FFT) signal, through a small Low Pass Filter, in order to find out intervals of frequencies, where high signal energy is concentrated.

Kategorien

Mehr zu Measurements and Spatial Audio finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by