Acoustic signal analysis is a cornerstone of modern noise control engineering. Whether you are evaluating industrial machinery noise, designing quieter HVAC systems, or measuring environmental sound levels, the ability to accurately capture and interpret acoustic data is essential. MATLAB provides an integrated environment that combines numeric computation, visualization, and domain-specific toolboxes, making it an ideal platform for both teaching and applied research in acoustics. This expanded guide walks through the complete workflow—from importing raw audio to extracting meaningful features—while highlighting practical tips that educators and students can immediately apply to noise control projects.

Understanding Acoustic Signals and Noise Control

Acoustic signals are pressure variations propagating through a medium such as air. In noise control engineering, these signals are typically characterized by their frequency content, amplitude, and temporal behavior. Noise can be stationary (continuous background hum) or transient (impact noises, impulsive events). The primary goal of noise control is to reduce sound levels that are harmful or annoying, measured in decibels (dB) often with A-weighting (dBA) to approximate human hearing sensitivity.

Engineers rely on signal processing to identify dominant noise sources, track frequency shifts over time, and evaluate the effectiveness of mitigation strategies such as barriers, absorbers, or active noise cancellation. MATLAB’s Signal Processing Toolbox and Audio Toolbox offer ready‑to‑use functions for filtering, spectral analysis, and feature extraction, turning raw waveforms into actionable insight.

Setting Up the MATLAB Environment for Acoustic Work

Before diving into analysis, confirm that your MATLAB installation includes the necessary toolboxes. At a minimum, the Signal Processing Toolbox is required for filtering, FFT operations, and spectral estimation. The Audio Toolbox is beneficial when working with real‑time audio streams or advanced acoustic features such as mel‑frequency cepstral coefficients (MFCCs). For data acquisition from microphones or sound level meters, the Data Acquisition Toolbox provides drivers for common hardware (e.g., NI‑DAQ, National Instruments devices).

Acoustic data can originate from recorded files (.wav, .flac, .mp3) or live sensor streams. For educational purposes, .wav files are preferred because they store uncompressed, linear PCM data without loss of information. When recording your own samples, use a calibrated microphone and an audio interface with at least a 44.1 kHz sampling rate (48 kHz is common for noise studies). Ensure the recording chain introduces minimal self‑noise.

MATLAB reads standard audio formats via audioread. For more complex multi‑channel data or proprietary formats, consider using audioDatastore to manage large datasets.

Importing and Preprocessing Acoustic Data

Loading Audio Files

The first step in any analysis pipeline is importing the signal. The following code snippet loads a stereo .wav file and keeps only the first channel for simplicity:

[signal, Fs] = audioread('factory_floor_noise.wav');
signal = signal(:,1); % select left channel

Variables signal and Fs contain the raw amplitude values (typically normalized to ±1) and the sampling rate in Hz. Always verify Fs to avoid misinterpretation of frequency axes later.

Resampling and Normalization

If your recordings have different sample rates, use resample to bring them to a common rate. This is critical when comparing multiple recordings or when applying fixed filter designs. Normalization to a common amplitude range (e.g., ±1 or to the maximum absolute value) helps during visualization but should be done with caution if absolute sound pressure levels are required.

% Resample to 44.1 kHz if Fs is not already 44100
if Fs ~= 44100
    [signal, Fs] = resample(signal, 44100, Fs);
end

Time‑Domain Visualization

Plotting the raw waveform reveals overall amplitude variations, clipping, and transient events. Use a time vector generated from the sample indices:

t = (0:length(signal)-1) / Fs;
plot(t, signal);
xlabel('Time (s)'); ylabel('Amplitude');
title('Raw Acoustic Signal – Factory Floor Noise');

For long recordings, zoom in on a representative segment. A spectrogram (discussed later) provides a more informative view, but the time domain plot is still useful for detecting impulsive noise.

Filtering and Noise Reduction Techniques

Unwanted background noise often contaminates the signal of interest. Filtering helps isolate frequencies associated with a particular noise source or removes sensor bias.

Designing FIR and IIR Filters

MATLAB’s designfilt function offers a convenient way to create filters. For acoustic work, band‑pass filters are common when the target noise occupies a known frequency range. For example, an engine’s dominant blade‑pass frequency might lie between 500 Hz and 2 kHz.

bpFilter = designfilt('bandpassfir', 'FilterOrder', 30, ...
    'CutoffFrequency1', 500, 'CutoffFrequency2', 2000, 'SampleRate', Fs);
filteredSignal = filtfilt(bpFilter, signal);

The filtfilt function applies zero‑phase filtering, which preserves the original timing of transients. For real‑time or causal applications, use filter instead and accept a slight phase shift.

IIR vs. FIR: Practical Considerations

IIR filters (Butterworth, Chebyshev) require lower orders for a given roll‑off but introduce non‑linear phase distortion. FIR filters are linear‑phase and better suited for time‑sensitive analyses like impulse response measurement. In educational settings, start with FIR band‑pass filters because the phase response is predictable.

Frequency Spectrum Analysis

Converting the signal into the frequency domain reveals the distribution of acoustic energy across frequencies. The Fast Fourier Transform (FFT) is the fundamental tool.

Basic FFT and Single‑Sided Spectrum

The following code computes a single‑sided magnitude spectrum from the filtered signal:

n = length(filteredSignal);
Y = fft(filteredSignal);
P2 = abs(Y / n);
P1 = P2(1:floor(n/2)+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs * (0:floor(n/2)) / n;
plot(f, P1);
xlabel('Frequency (Hz)'); ylabel('Magnitude');
title('Single‑Sided Amplitude Spectrum');

Plotting on a logarithmic y‑axis (dB scale) is often more meaningful because the human ear perceives sound intensity logarithmically:

plot(f, 20*log10(P1 + eps)); ylabel('Magnitude (dB)');

Windowing and Power Spectral Density

A direct FFT assumes the signal is periodic, which can cause spectral leakage. Windowing (e.g., using a Hann window) reduces this artifact. For a more statistically robust estimate, use MATLAB’s pwelch function, which averages multiple overlapping windowed segments:

[pxx, f_pwelch] = pwelch(filteredSignal, hann(1024), 512, 1024, Fs);
plot(f_pwelch, 10*log10(pxx));
xlabel('Frequency (Hz)'); ylabel('Power/Frequency (dB/Hz)');

The pwelch output is a power spectral density (PSD) estimate, which is the standard metric for broadband noise analysis. Its value in dB/Hz is directly comparable across different sampling rates and window lengths.

Spectrograms for Time‑Frequency Analysis

When noise characteristics change over time (e.g., a passing truck, rotating machinery), a spectrogram shows how the frequency content evolves. MATLAB’s spectrogram function generates a time‑frequency plot:

[s, f_spec, t_spec] = spectrogram(filteredSignal, hann(256), 128, 256, Fs, 'yaxis');
imagesc(t_spec, f_spec, 20*log10(abs(s) + eps));
axis xy; colorbar;
xlabel('Time (s)'); ylabel('Frequency (Hz)');
title('Spectrogram – Factory Floor Noise');

Spectrograms are invaluable for identifying harmonic patterns (e.g., engine orders) and transient events. Adjust the window length to trade off between time resolution and frequency resolution: shorter windows capture rapid changes but smear frequencies; longer windows provide fine frequency detail at the cost of temporal blur.

Extracting Key Acoustic Features

Quantitative features condense complex signals into metrics that correlate with perceived loudness, annoyance, or source identification.

Spectral Centroid and Bandwidth

The spectral centroid indicates the “center of mass” of the spectrum. A higher centroid corresponds to a brighter, more high‑frequency sound.

centroid = sum(f_pwelch .* pxx) / sum(pxx);

Spectral bandwidth (spread around the centroid) can be computed with:

bandwidth = sqrt( sum( ((f_pwelch - centroid).^2) .* pxx ) / sum(pxx) );

Sound Pressure Level (SPL) Calculation

To obtain absolute sound pressure levels in dB, the raw signal must be calibrated to a known reference. For uncalibrated recordings, you can compute the RMS level relative to the digital full‑scale value:

rms_level = 20*log10( rms(filteredSignal) / 1e-5 );

This gives dB SPL relative to 20 µPa only if the recording chain’s sensitivity is known. In educational settings, relative comparisons are often sufficient.

Harmonic Analysis

Periodic noise from rotating machinery produces harmonics at integer multiples of the fundamental frequency. The findpeaks function on the PSD can locate peaks and their harmonics:

[pks, locs] = findpeaks(pxx, ‘MinPeakHeight’, 0.01);
harmonics = f_pwelch(locs);

Visualizing these peaks over the spectrum helps identify the dominant tonal components.

Advanced Techniques for Noise Control Studies

Cepstral Analysis

The cepstrum (inverse Fourier transform of the log spectrum) separates excitation source from vocal tract or housing resonance. In noise control, cepstral analysis can isolate repetitive impacts or engine firing frequencies. Use rceps for the real cepstrum:

cepstrum = rceps(filteredSignal);
plot(cepstrum);

Quefrency values (the “time” axis of the cepstrum) corresponding to high peaks indicate the period of repetitive events.

Wavelet Denoising

For non‑stationary signals with broadband noise, wavelet transform provides adaptive time‑frequency decomposition. The wdenoise function (Wavelet Toolbox) can remove noise while preserving sharp transients:

denoisedSignal = wdenoise(filteredSignal, 5, 'Wavelet', 'sym4');

Wavelet denoising is especially useful when dealing with impulsive noise where standard band‑pass filters would remove the transient itself.

Practical Applications in Noise Control Engineering

Measuring Sound Absorption Coefficient

Using the impedance tube method, engineers can compute the absorption coefficient from two‑microphone recordings. MATLAB automates the transfer function calculation between microphones. The tfestimate function computes the frequency response:

[Txy, f_tf] = tfestimate(mic1_signal, mic2_signal, hann(1024), 512, 1024, Fs);

From the transfer function, the absorption coefficient is derived using standard formulas (ASTM E1050).

Active Noise Control (ANC) Simulation

MATLAB’s Audio Toolbox includes a System object dsp.LMSFilter that can simulate adaptive feedforward ANC. A simple demonstration uses a sinusoidal noise source and an adaptive filter to cancel it at the error microphone. While real‑world ANC requires careful hardware synchronization, simulation helps students grasp the underlying LMS algorithm.

lms = dsp.LMSFilter(32, 'StepSize', 0.01);
[~, y] = lms(noise, error_mic_signal);

Best Practices for Educational and Research Projects

  • Always document the calibration chain: note microphone sensitivity, gain settings, and recording format. This makes results reproducible.
  • Use consistent windowing: when computing PSDs, state the window type, length, and overlap. In publications, follow ANSI S1.11 for octave‑band analysis.
  • Apply A‑weighting: to correlate with human perception, weight your spectrum using the standard A‑weighting curve (available in Audio Toolbox as weightingFilter).
  • Test with synthetic signals first: generate known sinusoids or chirps to verify your filter designs and FFT implementations before analyzing real noisy recordings.
  • Parallel processing: for large datasets (hours of recordings), use parfor or tall arrays to speed up analysis.

External Resources for Deeper Learning

To further develop your skills, explore MathWorks’ documentation on Signal Processing Toolbox. A classic tutorial on FFT analysis is available at the MATLAB FFT documentation. For noise control standards, consult the Acoustical Society of America and the ANSI store for relevant measurement standards.

Conclusion

MATLAB equips noise control engineers and students with a powerful, flexible environment for acoustic signal analysis. By mastering the steps outlined here—importing audio, filtering, spectral analysis, and feature extraction—you can confidently tackle real‑world noise problems. Whether you are teaching the fundamentals of Fourier analysis or designing a practical monitoring system, the combination of MATLAB’s built‑in functions and your own algorithmic creativity will yield insightful results. Start with simple recordings, experiment with different window lengths and filter orders, and gradually incorporate advanced tools like wavelet denoising and cepstral analysis. The skills you build today will serve you well in the diverse and impactful field of noise control engineering.