diff --git a/src/NotWorking/epic_effect_schluep.m b/src/Filter/epic_effect_schluep.m similarity index 78% rename from src/NotWorking/epic_effect_schluep.m rename to src/Filter/epic_effect_schluep.m index 2ad7109..6ff54c3 100644 --- a/src/NotWorking/epic_effect_schluep.m +++ b/src/Filter/epic_effect_schluep.m @@ -15,13 +15,22 @@ function output = epic_effect_schluep(input, Fs, LOW, MED, HIGH) % HIGH: The maximum frequency the filter will amplify. A typical value for % this variable is 1000 Hz. -non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound -% by just taking the first column of data. +n = size(input, 2); -Len = length(non_stereophonic); +non_stereophonic = input; + +if (n == 1) || (n == 2) + non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound + % by just taking the first column of data. + non_stereophonic = transpose(non_stereophonic); +end + +modified_input = non_stereophonic(1, :); + +Len = length(modified_input); F = Fs * ((-Len/2) : ((Len/2) - 1)) / Len; % Creating the array of frequencies % which the FFT Shifted version of the signal can be plotted against. -inputFreq = fftshift(fft(non_stereophonic)); % Creates the Fourier Transform of the +inputFreq = fftshift(fft(modified_input)); % Creates the Fourier Transform of the % input signal. fftshift() makes it such that the zero frequency is at the % center of the array. lowAmplifyFilter = zeros(1, length(inputFreq)); @@ -35,7 +44,8 @@ for i = 1:length(lowAmplifyFilter) end end -lowPassedInput = inputFreq .* transpose(lowAmplifyFilter); %Apply the "lowAmplifyFilter". +lowPassedInput = inputFreq .* lowAmplifyFilter; %Apply the "lowAmplifyFilter". +lowPassedInput = transpose(lowPassedInput); % Adding the chorus effect. realOutput = real(ifft(fftshift(lowPassedInput))); @@ -53,3 +63,7 @@ for i = 1:100 end output = output ./ 100; % Divide by 100 to decrease the amplitude of the sound to a normal level. + +output = transpose(output); + +end \ No newline at end of file diff --git a/src/NotWorking/muffled_effect_schluep.m b/src/Filter/muffled_effect_schluep.m similarity index 76% rename from src/NotWorking/muffled_effect_schluep.m rename to src/Filter/muffled_effect_schluep.m index c193a38..7e611ac 100644 --- a/src/NotWorking/muffled_effect_schluep.m +++ b/src/Filter/muffled_effect_schluep.m @@ -13,13 +13,22 @@ function output = muffled_effect_schluep(input, Fs, LOW, MED, HIGH) % HIGH: The maximum frequency that the low-pass filter will let pass. A % typical value for this variable is 1000 Hz. -non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound -% by just taking the first column of data. +n = size(input, 2); -Len = length(non_stereophonic); +non_stereophonic = input; + +if (n == 1) || (n == 2) + non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound + % by just taking the first column of data. + non_stereophonic = transpose(non_stereophonic); +end + +modified_input = non_stereophonic(1, :); + +Len = length(modified_input); F = Fs * ((-Len/2) : ((Len/2) - 1)) / Len; % Creating the array of frequencies % which the FFT Shifted version of the signal can be plotted against. -inputFreq = fftshift(fft(non_stereophonic)); % Creates the Fourier Transform of the +inputFreq = fftshift(fft(modified_input)); % Creates the Fourier Transform of the % input signal. fftshift() makes it such that the zero frequency is at the % center of the array. lowPassFilter = zeros(1, length(inputFreq)); @@ -33,7 +42,8 @@ for i = 1:length(lowPassFilter) end end -lowPassedInput = inputFreq .* transpose(lowPassFilter); %Apply the low-pass filter. +lowPassedInput = inputFreq .* lowPassFilter; %Apply the low-pass filter. +lowPassedInput = transpose(lowPassedInput); % Adding a slight reverb effect. realOutput = real(ifft(fftshift(lowPassedInput))); @@ -50,6 +60,10 @@ output = (realOutput + delayedOutput) ./ 2.0; % Adds the "realOutput" and "de % vectors to create a reverb effect. Divides by 2 to avoid clipping % effects. +output = transpose(output); + +end + diff --git a/src/NotWorking/seperate_prevalent_schluep.m b/src/Filter/seperate_prevalent_schluep.m similarity index 77% rename from src/NotWorking/seperate_prevalent_schluep.m rename to src/Filter/seperate_prevalent_schluep.m index 3fbc7a6..a1312c8 100644 --- a/src/NotWorking/seperate_prevalent_schluep.m +++ b/src/Filter/seperate_prevalent_schluep.m @@ -14,13 +14,22 @@ function output = seperate_prevalent_schluep(input, Fs, LOW, MED, HIGH) % not be attenuated. A good range of values is usually 250-500 Hz, but it % depends on the input sound. -non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound -% by just taking the first column of data. +n = size(input, 2); -Len = length(non_stereophonic); +non_stereophonic = input; + +if (n == 1) || (n == 2) + non_stereophonic = input(:, 1); % Removes the sterophonic property of the input sound + % by just taking the first column of data. + non_stereophonic = transpose(non_stereophonic); +end + +modified_input = non_stereophonic(1, :); + +Len = length(modified_input); F = Fs * ((-Len/2) : ((Len/2) - 1)) / Len; % Creating the array of frequencies % which the FFT Shifted version of the signal can be plotted against. -inputFreq = fftshift(fft(non_stereophonic)); % Creates the Fourier Transform of the +inputFreq = fftshift(fft(modified_input)); % Creates the Fourier Transform of the % input signal. fftshift() makes it such that the zero frequency is at the % center of the array. bandPassFilter = zeros(1, length(inputFreq)); @@ -53,10 +62,12 @@ for i = 1:length(bandPassFilter) end end -bandPassedInput = inputFreq .* transpose(bandPassFilter); %Apply the Band-Pass Filter. +bandPassedInput = inputFreq .* bandPassFilter; %Apply the Band-Pass Filter. output = real(ifft(fftshift(bandPassedInput))); +end + diff --git a/src/Select/FilterSelect.m b/src/Select/FilterSelect.m index b3fd883..20aecaf 100644 --- a/src/Select/FilterSelect.m +++ b/src/Select/FilterSelect.m @@ -11,17 +11,14 @@ function output = FilterSelect(input,Fs,LOW,MED,HIGH,number) output = DarellbandpassFilter(input,Fs,LOW,MED,HIGH); elseif(number == "AmplifyRange") output = amplifyFreqRange(input, Fs, LOW, MED, HIGH); - %{ elseif(number == "EpicEffect") output = epic_effect_schluep(input, Fs, LOW, MED, HIGH); elseif(number == "MuffledEffect") output = muffled_effect_schluep(input, Fs, LOW, MED, HIGH); elseif(number == "SeparatePrevalent") output = seperate_prevalent_schluep(input, Fs, LOW, MED, HIGH); - %} elseif(number == "IdealBandReject") output = bandreject_filter(input, Fs, LOW, HIGH); - elseif(number == "EnchanceTarget") output = AnuragEnhanceTarget(input, Fs, LOW, MED, HIGH); elseif(number == "DampenTarget")