Merge branch 'main' into AnuragFilters

This commit is contained in:
TurtleEmperorx
2021-12-10 15:35:19 -08:00
committed by GitHub
12 changed files with 52 additions and 154 deletions

View File

@@ -26,7 +26,6 @@ function output_x = AnuragDampenTarget(x, Fs,LOW, MID, HIGH)
output(n) = 1;
end
end
%%Filter the original signal and transform
filtered_Mod_Freq = fftshift(Mod_Freq .* output);
output_x = real(ifft(filtered_Mod_Freq));

View File

@@ -15,6 +15,7 @@ function output_x = AnuragEnchanceTarget(x, Fs,LOW, MID, HIGH)
lenf = length(F);
Mod_Freq = fftshift(fft(x)); %Fourier Transform of the input signal
output = zeros([1,lenf]); % zero array of size Mod_freq
%set the bounds
lowerBound = (1-AreaPercentage) * TARGET;
upperBound = (1+AreaPercentage) * TARGET;

View File

@@ -1,26 +1,30 @@
% An audio is distorted based on the value of HIGH. Nothing of a certain
% threshold should be played above this constant, or they are simply clipped to this
% value. Inspired from Meghaj_Echo.m and epic_effect_schluep.m.
% Author: Jason Liang
function y = distortion_filter(x, HIGH)
len = length(X);
X = fft(x);
X = fftshift(X);
Y = zeros(1, len);
for ind = 1:len
if (X(ind) > HIGH)
Y(ind) = HIGH;
elseif (X(ind) < -HIGH)
Y(ind) = -HIGH;
else
Y(ind) = X(ind);
end
end
Y = fftshift(Y);
y = ifft(Y);
y = real(y);
end
% An audio is distorted based on the value of HIGH. Nothing of a certain
% threshold should be played above this constant, or they are simply clipped to this
% value. Inspired from Meghaj_Echo.m and epic_effect_schluep.m.
% Author: Jason Liang
% Mekhi Ellington: Added some comments and editted formatting
function y = distortion_filter(x, HIGH)
len = length(X); %Storing length of X.
X = fft(x); %X is the Fourier Transform of x.
X = fftshift(X); %Shifts X.
Y = zeros(1, len); %Matrix of length containing zeros.
for ind = 1:len
if (X(ind) > HIGH)
Y(ind) = HIGH;
elseif (X(ind) < -HIGH)
Y(ind) = -HIGH;
else
Y(ind) = X(ind);
end
end
Y = fftshift(Y); %Shifts Y.
y = ifft(Y); %Inverse Fourier Transform of Y.
y = real(y); %Stores only the real part of the complex y.
end