Main Content

roomNoiseCriteria

R2026b

Evaluate room background noise using room noise criteria (RNC) curves

Since R2026b

    Description

    RNC = roomNoiseCriteria(audioIn,fs) returns the room noise criteria (RNC) level according to the ANSI/ASA S12.2-2019 standard [1].

    example

    RNC = roomNoiseCriteria(Leq,Lt) computes the RNC level using equivalent continuous sound pressure level (SPL) measurements and time-weighted SPL measurements across octave bands.

    example

    RNC = roomNoiseCriteria(___,Name=Value) specifies options using one or more name-value arguments.

    [RNC,rattleRisk] = roomNoiseCriteria(___) also returns a structure detailing the likelihood of acoustically induced vibrations and rattles.

    roomNoiseCriteria(___) without any output arguments plots the octave band SPL measurements against RNC curves and displays the RNC level.

    Examples

    collapse all

    Load a recording of a room with background noise.

    [audioIn, fs] = audioread("office_kitchen_44p1_20s.wav");

    If possible, enter the calibration factor for the microphone used to make the recording or calculate it using calibrateMicrophone. The microphone in this example has an associated reference recording at 1 kHz with an SPL meter reading of 64 dB.

    [audioRef, fsRef] = audioread("1khz_64db_44p1.wav");
    SPLreading = 64;
    calibrationFactor = calibrateMicrophone(audioRef,fsRef,SPLreading)
    calibrationFactor = 
    2.0836
    

    Plot the RNC level for the room recording.

    roomNoiseCriteria(audioIn,fs,CalibrationFactor=calibrationFactor)

    Figure contains an axes object. The axes object with title Room Noise Criteria, xlabel Octave-Band Center Frequency (Hz), ylabel Sound Pressure Level (dB) contains 28 objects of type line, text. These objects represent Measurement, RNC-43.

    Collect equivalent continuous sound level (Leq) measurements and time-weighted sound level (Lt) measurements of a room using a sound pressure level (SPL) meter with octave band filters centered at 16, 31.5, 63, 125, 250, 500, 1000, 2000, 4000, and 8000 Hz.

    Simulate the measurements.

    Leq = [66, 58, 52, 49, 44, 46, 44, 38, 31, 19];
    Lt = zeros(1500,10) + Leq; % readings collected every 100 ms
    fmod = cos(2*pi*(0:1499)/100)';
    Lt(:,1) = Lt(:,1) + 7*fmod; % 1 Hz, 14 dB surging in 16 Hz octave band
    Lt(:,2) = Lt(:,2) + 6*fmod; % 1 Hz, 16 dB surging in 31.5 Hz octave band
    Lt(:,3) = Lt(:,3) + 6*fmod; % 1 Hz, 12 dB surging in 63 Hz octave band
    Lt(:,4) = Lt(:,4) + 4*fmod; % 1 Hz, 8 dB surging in 125 Hz octave band

    Use roomNoiseCriteria to calculate the room noise criteria (RNC) level using the readings from the SPL meter.

    roomNoiseCriteria(Leq,Lt)

    Figure contains an axes object. The axes object with title Room Noise Criteria, xlabel Octave-Band Center Frequency (Hz), ylabel Sound Pressure Level (dB) contains 29 objects of type line, text. These objects represent Measurement, Corrected Measurement, RNC-42.

    The ANSI/ASA S12.2-2019 standard requires the Room Noise Criteria (RNC) to be used instead of the Noise Criteria (NC) when surging or large random fluctuations occur in low-frequency octave bands. If the noiseCriteria function detects these conditions, it issues a warning recommending that you use roomNoiseCriteria instead.

    Simulate a recording of a washing machine in a shoebox room using acousticRoomResponse.

    [audioIn,fs] = audioread('WashingMachine-16-44p1-stereo-10secs.wav');
    audioIn = mean(audioIn,2);
    roomDimensions = [10,8,5];
    tx = [9,7,2]; % near back of room
    rx = roomDimensions / 2; % center of room
    rng(1);
    ir = acousticRoomResponse(roomDimensions,tx,rx,SampleRate=fs,ImageSourceOrder=6,...
        MaxNumRayReflections=50,NumStochasticRays=4000);
    x = fftfilt(ir',audioIn);

    Calculate the NC from the recording.

    NC = noiseCriteria(x,fs)
    Warning: Large random fluctuations detected. To follow ANSI/ASA S12.2-2019, use roomNoiseCriteria instead.
    
    NC = 
    "NC-57 (1000 Hz)"
    

    The warning states that you should use roomNoiseCriteria due to the presence of large random fluctuations. To evaluate the noise in this room, use the RNC metric instead.

    RNC = roomNoiseCriteria(x,fs)
    RNC = 
    "RNC-56 (1000 Hz)"
    

    Input Arguments

    collapse all

    Audio input, specified as a column vector of real finite numbers. If audioIn is not calibrated, you can determine the calibration factor using calibrateMicrophone. When surging or large random fluctuations are present, audioIn must contain enough samples to represent at least 15 seconds of audio at sample rate fs.

    Specify either audioIn and fs or Leq and Lt.

    For guidance on taking compliant measurements, see Calibration Factor for Audio Recordings.

    Data Types: single | double

    Sample rate in Hz, specified as a scalar equal to or greater than 16 kHz.

    Specify either audioIn and fs or Leq and Lt.

    Octave-band equivalent continuous sound level (Leq) measurements in decibels (dB), specified as a 10-element row vector. Each element must correspond to a measurement at nominal octave band center 16, 31.5, 63, 125, 250, 500, 1000, 2000, 4000, and 8000 Hz, respectively.

    If the SPL for a given band is unknown, specify it as missing. An RNC level calculated with missing Leq values might not be compliant with ASA S12.2-2019.

    Specify either audioIn and fs or Leq and Lt.

    For guidance on taking compliant measurements, see Obtaining Standard-Compliant Sound Level Measurements.

    Data Types: single | double

    Octave-band time-weighted (Lt) measurements in decibels (dB), specified as an N-by-10-matrix where N is the number of samples from the SPL meter. Each column must correspond to a measurement at nominal octave band center 16, 31.5, 63, 125, 250, 500, 1000, 2000, 4000, and 8000 Hz, respectively.

    For guidance on taking compliant measurements, see Obtaining Standard-Compliant Sound Level Measurements.

    Specify either audioIn and fs or Leq and Lt.

    Data Types: single | double

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: roomNoiseCriteria(audioIn,fs,IsSurging=false)

    Microphone calibration factor, specified as a positive scalar. audioIn is multiplied by CalibrationFactor before analysis. To compute the calibration factor specific to your system, use the calibrateMicrophone function.

    CalibrationFactor is valid only when you specify the first argument as audioIn.

    Data Types: single | double

    Reference pressure for dB calculation in pascals, specified as a positive scalar. The default value, 20 micropascals, is the common value for air.

    PressureReference is valid only when you specify the first argument as audioIn.

    Data Types: single | double

    Option to specify or screen audio input for surging, specified as "auto-detect", true, or false. If you set IsSurging to "auto-detect", roomNoiseCriteria uses a nonstandard heuristic to detect whether surging is present. If roomNoiseCriteria detects surging or if you set IsSurging to true, roomNoiseCriteria adjusts SPL measurements in low-frequency octave bands according to the standard.

    For more information on surging and low-frequency band adjustments, see Screening for Surging and Corrections to Low-Frequency Octave-Band Measurements.

    IsSurging is valid only when you specify the first argument as audioIn.

    Data Types: string | logical

    Option to specify or screen audio input for large random fluctuations, specified as "auto-detect", true, or false. If you set IsFluctuating to true, roomNoiseCriteria follows screening criteria from ASA S12.2-2019 to determine if large random fluctuations are present. If roomNoiseCriteria detects large random fluctuations or if you set IsFluctuating to true, roomNoiseCriteria adjusts SPL measurements in low-frequency octave bands according to the standard.

    For more information on screening for large random fluctuations and low-frequency band adjustments, see Screening for Large Random Fluctuations and Corrections to Low-Frequency Octave-Band Measurements.

    IsFluctuating is valid only when you specify the first argument as audioIn.

    Data Types: string | logical

    Output Arguments

    collapse all

    RNC level, returned as a string. RNC has the form RNC-CurveID (TC), where CurveID is the RNC Curve tangent to the SPL measurements and TC is the tangency frequency in Hz.

    For more information on the RNC tangency method, see RNC Tangency Method.

    Risk of acoustically induced vibrations and rattles, returned as a structure. rattleRisk contains a summary of octave bands that can contain perceptible rattle and the table of values used by the function to determine the risk.

    For more information on rattle risk, see Rattle Risk.

    More About

    collapse all

    References

    [1] Acoustical Society of America. Criteria for Evaluating Room Noise. ANSI/ASA S12.2-2019 (R2023). Acoustical Society of America, 2019.

    Version History

    Introduced in R2026b