function y = ringmod( x, freq, depth, fs)
%RINGMOD ring modulates input signal at specified frequency and depth
% x = input signal
% freq = frequency of the ring modulator
% depth = ranges 0 (no ringmod added) to 1 (equal amplitude added)
% fs is sampling freq of input signal

n = (1:length(x))';
wave = depth*sin(2*pi*freq/fs .*n); % create a carrier wave of length
% equal to the input signal
modulated = wave.*x; % multiply the carrier wave by the modulator

y = x + modulated; % add the unprocessed signal to the modulated signal

end