Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute MATLAB/Octave Online

clear, clc, close all

[x, fs] = wavread('C:\Users\student\Downloads\sample.wav');    % get the sound file 
x = x(:, 1);                        % get the first channel
xmax = max(abs(x));                 % find the maximum value
x = x/xmax;                         % scale the signal

% time vector generation
N = length(x);
t = (0:N-1)/fs;    

% cepstral analysis
[C, q] = cepstrum(x, fs);

% plot of the signal
figure(1)
subplot(2, 1, 1)
plot(t, x, 'r')
xlim([0 max(t)])
ylim([-1.1*max(abs(x)) 1.1*max(abs(x))])
grid on
set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)
xlabel('Time, s')
ylabel('Normalized amplitude')
title('The signal in the time domain')

% plot of the cepstrum
% 1 ms minimum speech quefrency (1000 Hz) and 20 ms maximum speech quefrency (50 Hz)
subplot(2, 1, 2)
plot(q*1000, C, 'r');
grid on
xlim([1 20])      
set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)
xlabel('Quefrency, ms')
ylabel('Amplitude')
title('Amplitude cepstrum of the signal (quefrencies from 1 ms to 20 ms)')

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.