Update speech_analysis_complete_sampling_part. Add missing parts to chavocoder_execution.m. Update sound files
This commit is contained in:
parent
6806d93bf7
commit
666ad4d3d2
|
|
@ -1,5 +1,5 @@
|
|||
modfile = 'Sound/modulator22.wav';
|
||||
carfile = 'Sound/carrier22.wav';
|
||||
carfile = 'Sound/white.wav';
|
||||
outfile = 'Sound/vocodedsound.wav';
|
||||
|
||||
[modul, sr1] = audioread(modfile);
|
||||
|
|
@ -12,3 +12,34 @@ end
|
|||
y = chanvocoder(carrier, modul, 512, 16, 0.2);
|
||||
audiowrite(outfile, y, sr1);
|
||||
|
||||
% Plot temporal variations of modulator, carrier, and output signals
|
||||
t_mod = (0:length(modul)-1) / sr1;
|
||||
t_car = (0:length(carrier)-1) / sr1;
|
||||
t_out = (0:length(y)-1) / sr1;
|
||||
|
||||
figure;
|
||||
subplot(3,1,1);
|
||||
plot(t_mod, modul);
|
||||
title('Modulator Signal');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
|
||||
subplot(3,1,2);
|
||||
plot(t_car, carrier);
|
||||
title('Carrier Signal');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
|
||||
subplot(3,1,3);
|
||||
plot(t_out, y);
|
||||
title('Output Signal');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
|
||||
% Compute spectrogram of modulator, carrier, and output signals
|
||||
spectrogram(modul, sr1, 5, 30);
|
||||
|
||||
spectrogram(carrier, sr1, 5, 30);
|
||||
|
||||
spectrogram(y, sr1, 5, 30);
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,11 @@ cutoff_freq_iir = 1000; % in Hz
|
|||
[b, a] = butter(iir_order, cutoff_freq_iir / (Fs/2), 'low');
|
||||
|
||||
% Check IIR filter stability
|
||||
poles = roots(a); % Compute poles
|
||||
iir_stable = all(abs(roots(a)) < 1); % Check if all poles are inside the unit circle
|
||||
fprintf('IIR filter stability: %d\n', iir_stable);
|
||||
fprintf('Poles of the IIR filter: ');
|
||||
disp(poles');
|
||||
|
||||
% Apply IIR filter to the original signal
|
||||
filtered_signal_iir = filter(b, a, signal);
|
||||
|
|
@ -185,6 +188,6 @@ ylabel('Amplitude');
|
|||
title('IIR Filtered Signal (Downsampled)');
|
||||
|
||||
% Write downsampled signals to audio files
|
||||
audiowrite('downsampled_signal1.wav', downsampled_filtered_signal_fir, 4000);
|
||||
audiowrite('downsampled_signal2.wav', downsampled_filtered_signal_iir, 4000);
|
||||
audiowrite('downsampled_signal1_fir.wav', downsampled_filtered_signal_fir, 4000);
|
||||
audiowrite('downsampled_signal2_iir.wav', downsampled_filtered_signal_iir, 4000);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue