Creating Noise / Filtering With Matlab FFT for Tap Sound Masking

  • Context: MATLAB 
  • Thread starter Thread starter nicoleisalie
  • Start date Start date
  • Tags Tags
    Filter Matlab Noise
Click For Summary
SUMMARY

This discussion focuses on generating noise with spectral properties similar to a recorded tapping sound using MATLAB's FFT for sound masking. The user initially attempts to create noise using the command noise=complex(randn(m, 1), randn(m, 1)*sqrt(p/2)), but lacks clarity on the parameters m and p. It is concluded that using the absolute value of the FFT may lead to loss of important data when converting back to the time domain. The recommended approach is to utilize MATLAB's wgn function to generate white noise.

PREREQUISITES
  • Understanding of MATLAB programming and syntax
  • Familiarity with Fast Fourier Transform (FFT) concepts
  • Knowledge of noise generation techniques in signal processing
  • Basic principles of sound masking and spectral properties
NEXT STEPS
  • Learn how to use MATLAB's wgn function for generating white noise
  • Explore the implications of using absolute values in FFT and inverse FFT
  • Study the principles of spectral analysis in sound processing
  • Investigate advanced techniques for sound masking and noise shaping
USEFUL FOR

Audio engineers, sound designers, and researchers in acoustics looking to mask unwanted sounds using spectral techniques in MATLAB.

nicoleisalie
Messages
1
Reaction score
0
I am trying to create noise that has similar spectral properties of a recorded tapping sound (so that I can mask the tapping sound). I was thinking that if I generate noise, and then multiply the fft of the noise by the fft of the tap sound, it would sort of "filter" the noise to the desired fft.

First off, I'm not 100% sure on how to create the noise. I am currently using:
noise=complex(randn(m, 1), randn(m, 1)*sqrt(p/2)
because I found an example online. I'm not really sure if this is white gaussian noise, or what. I'm also not sure what the m and p are.

Secondly, if I use abs(fft(noise)) and then multiple that by the abs(fft(TapSound)), I get the desired fft that I want (I think...?). but then if I use ifft to get back to the sound wave, won't that be missing important data because I used an absolute value?

Any help you can give me would be appreciated. Thank you!
 
Physics news on Phys.org
The function randn will return a value according to the Gaussian distribution specified by the parameters, but I don't think a vector of Gaussian random complex numbers is what you want (m is the length of the vector). The time domain values of the noise should be only real, and the frequency domain representation should be white. In other words, the magnitude of the frequency domain function should be flat or constant.

The MatLab function wgn can be used to create a vector of white noise.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
9K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
11
Views
6K
Replies
17
Views
6K