Merge pull request #13 from ltcptgeneral/DarellsAnnex
App is partially functional. Change directory to your directory inside the app to use functions.
This commit is contained in:
commit
e4ac5c04c2
Binary file not shown.
8
src/AmpEnvelopeSelect.m
Normal file
8
src/AmpEnvelopeSelect.m
Normal file
@ -0,0 +1,8 @@
|
||||
function output = AmpEnvelopeSelect(input, Fs, attack,decay,sustain,release,number)
|
||||
if(number == "Option 1")
|
||||
output = DarellAmplitudeEnvelope(input, Fs, attack,decay,sustain,release);
|
||||
else
|
||||
output = input;
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ function output_y = DarellbandpassFilter(y,Fs,LOW,MED,HIGH)
|
||||
F = Fs * (-Len/2 : (Len/2 - 1))/Len ;
|
||||
Mod_Freq = fftshift(fft(y));
|
||||
lenf = length(F);
|
||||
output = 0 .* Mod_Freq; % zero array of len f
|
||||
output = zeros([1,lenf]); % zero array of size Mod_freq
|
||||
|
||||
for n = 1:lenf
|
||||
if ((LOW < abs(F(n))) && HIGH > abs(F(n)))
|
||||
@ -14,7 +14,6 @@ function output_y = DarellbandpassFilter(y,Fs,LOW,MED,HIGH)
|
||||
end
|
||||
|
||||
filtered_Mod_Freq = fftshift(Mod_Freq .* output);
|
||||
|
||||
output_y = real(ifft(filtered_Mod_Freq));
|
||||
|
||||
end
|
8
src/PitchEnvelopeSelect.m
Normal file
8
src/PitchEnvelopeSelect.m
Normal file
@ -0,0 +1,8 @@
|
||||
function output = PitchEnvelopeSelect(input, Fs, attack,decay,sustain,release,number)
|
||||
if(number == "Option 1")
|
||||
output = DarellAmplitudeEnvelope(input, Fs, attack,decay,sustain,release);
|
||||
else
|
||||
output = input;
|
||||
end
|
||||
end
|
||||
|
13
src/SoundGeneratorSelect.m
Normal file
13
src/SoundGeneratorSelect.m
Normal file
@ -0,0 +1,13 @@
|
||||
function output = SoundGeneratorSelect(amplitude, frequency, phase, fs, duration, duty,number)
|
||||
if(number == "Option 1")
|
||||
output = generate_sine(amplitude, frequency, phase, fs, duration, duty);
|
||||
elseif(number == "Option 2")
|
||||
output = generate_square(amplitude, frequency, phase, fs, duration, duty);
|
||||
elseif(number == "Option 3")
|
||||
output = generate_triangle(amplitude, frequency, phase, fs, duration, duty);
|
||||
|
||||
else
|
||||
output = 0;
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user