Function SNRN forms an array of an audio signal which is corrupted with noise and signal-to-noise ratio has a specified value SNR. We suppose that SNR was defined as a ratio of the root-mean-square value of amplitudes of a signal A(s) and a noise A(n). It is supposed that value of SNR was expressed in decibels (dB). It is supposed, too, that both the signal and the noise were measured at the same points, within the same bandwidth, and
across the same impedance. Thus, for calculations we used the
following formula: SNR = 20log10(A(s)/A(n)). If array of noise has length not equal to length of array of signal then array of noise will be automatically resized to fit length of array of signal. It is supposed that audio signal was received via WAVREAD.
Under certain conditions the corrupted signal is normalized to prevent data clipping during recording with use of WAVWRITE. Normalization coefficient depends on number of bits per sample.
They are 8, 16 (default), 24, 32. Both signal and noise have a format - "double".
Eduard Polityko (2020). Formation of Audio Signal Corrupted with Noise (https://www.mathworks.com/matlabcentral/fileexchange/36914-formation-of-audio-signal-corrupted-with-noise), MATLAB Central File Exchange. Retrieved .