Ripple Sounds
Jump to navigation
Jump to search
Introduction
%todo
FFT-iFFT method
%todo
% create array with pink noise noise = pinknoise(n); % Create modulation for time domain sin_modulation_t = sin(2 * pi * ripples_per_sec * t + phi); cos_modulation_t = cos(2 * pi * ripples_per_sec * t + phi); % Create modulation for frequency domain sin_modulation_f = sin(2 * pi * ripples_per_octave * octaves); cos_modulation_f = cos(2 * pi * ripples_per_octave * octaves); % Mirror the modulation frequency components for ifft compatibility sin_modulation_f = [sin_modulation_f, fliplr(sin_modulation_f)]; cos_modulation_f = [cos_modulation_f, fliplr(cos_modulation_f)]; % apply time modulation to noise, perform fft fft_sin_mod_t = fft(sin_modulation_t .* noise); fft_cos_mod_t = fft(cos_modulation_t .* noise); %apply frequency modulation and perform ifft sin_modulated = ifft(sin_modulation_f .* fft_sin_mod_t, 'symmetric'); cos_modulated = ifft(cos_modulation_f .* fft_cos_mod_t, 'symmetric'); % determine the ripple type (ascending vs. Descending) switch obj.rippleType case ascending rippleStimulus = sin_modulated + cos_modulated; case descending rippleStimulus = sin_modulated - cos_modulated; end % calculate the modulated stimulus rippleStimulus = noise + modulationDepth * rippleStimulus;
Band filter method
%todo