[Voice model] Mathematical model based on matlab voice signal [including Matlab source code 540]

1. Introduction

Mathematical model of speech signal based on matlab

Second, the source code

clc
clear all
close all
T1=5;                       %5ms
T2=3;                       %3ms
fs=8;                       %8kHz
N1=T1*fs;
N2=T2*fs;
n1=1:N1-1;
n2=N1:N1+N2;
g=zeros(1,20*fs);
t=(1:20*fs)/fs;
g(1:N1-1)=0.5*(1-cos(pi*n1/N1));
g(N1:N1+N2)=cos(pi*(n2-N1)/(2*N2));
plot(t,g)
ylim([-0.4,1.2])
line([0 20],[0 0])
line([5 5],[0 1],'LineStyle','--')
xlabel('时间/ms')
ylabel('g(n)')
title('(a)时域波形')

figure
N=length(g);
f=(0:N-1)*fs/N;
fftg=fft(g);
disg=20*log10(abs(fftg));
plot(f(1:N/2+1),disg(1:N/2+1))
line([0 fs/2],[0 0])
xlabel('频率/kHz')
 = [500 1500 2500];
sampleRate = 8000;
pitch = 100; 
f1=f(1);f2=f(2);f3=f(3);
%冲激函数
yt=zeros(1,8000);
yt(1)=1;

if f1 > 0
        cft = f1/sampleRate;
        bw = 50;
        q = f1/bw;
        rho = exp(-pi * cft / q);
        theta = 2 * pi * cft * sqrt(1-1/(4 * q*q));
        a2 = -2*rho*cos(theta);
        a3 = rho*rho;
        y=filter([1+a2+a3],[1,a2,a3],yt);
end;
figure
N=length(y);
fn=(0:N-1)*sampleRate/N;
fftg=fft(y);
disg=20*log10(abs(fftg));
plot(fn(1:N/2+1),disg(1:N/2+1))
% line([0 sampleRate/2],[0 0])
xlabel('频率/Hz')
ylabel('幅度/dB')
title('(a)第一共振峰的二阶谐振器')

%  根据指定的共振峰频率和带宽(50Hz)建模语音信号中的共振峰
% 第二共振峰
if f2 > 0
        cft = f2/sampleRate;
        bw = 50;
        q = f2/bw;
        rho = exp(-pi * cft / q);
        theta = 2 * pi * cft * sqrt(1-1/(4 * q*q));
        a2 = -2*rho*cos(theta);
        a3 = rho*rho;
        y=filter([1+a2+a3],[1,a2,a3],y);
end;
figure
N=length(y);
fn=(0:N-1)*sampleRate/N;
fftg=fft(y);
disg=20*log10(abs(fftg));
plot(fn(1:N/2+1),disg(1:N/2+1))
% line([0 sampleRate/2],[0 0])
xlabel('频率/Hz')

Three, running results

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Four, remarks

Complete code or writing add QQ 1564658423 past review
>>>>>>
[Feature extraction] Audio watermark embedding and extraction based on matlab wavelet transform [Include Matlab source code 053]
[Speech processing] Voice signal processing based on matlab GUI [Include Matlab Source code issue 290]
[Voice acquisition] based on matlab GUI voice signal collection [including Matlab source code 291]
[Voice modulation] based on matlab GUI voice amplitude modulation [including Matlab source code 292]
[Speech synthesis] based on matlab GUI voice synthesis [including Matlab Source code issue 293]
[Voice encryption] Voice signal encryption and decryption based on matlab GUI [With Matlab source code 295]
[Speech enhancement] Matlab wavelet transform-based voice enhancement [Matlab source code 296]
[Voice recognition] Based on matlab GUI voice base frequency Recognition [Including Matlab source code 294]
[Speech enhancement] Matlab GUI Wiener filtering based voice enhancement [Including Matlab source code 298]
[Speech processing] Based on matlab GUI voice signal processing [Including Matlab source code 299]
[Signal processing] Based on Matlab speech signal spectrum analyzer [including Matlab source code 325]
[Modulation signal] Digital modulation signal simulation based on matlab GUI [including Matlab source code 336]
[Emotion recognition] Voice emotion recognition based on matlab BP neural network [including Matlab source code 349 Issue]
[Voice Steganography] Quantified Audio Digital Watermarking Based on Matlab Wavelet Transform [Include Matlab Source Code Issue 351]
[Feature extraction] based on matlab audio watermark embedding and extraction [including Matlab source code 350 period]
[speech denoising] based on matlab low pass and adaptive filter denoising [including Matlab source code 352 period]
[emotion recognition] based on matlab GUI voice emotion classification Recognition [Including Matlab source code 354 period]
[Basic processing] Matlab-based speech signal preprocessing [Including Matlab source code 364 period]
[Speech recognition] Matlab Fourier transform 0-9 digital speech recognition [Including Matlab source code 384 period]
[Speech Recognition] 0-9 digital speech recognition based on matlab GUI DTW [including Matlab source code 385]
[Voice playback] Matlab GUI MP3 design [including Matlab source code 425]
[Voice processing] Speech enhancement algorithm based on human ear masking effect Noise ratio calculation [Including Matlab source code 428]
[Speech denoising] Based on matlab spectral subtraction denoising [Including Matlab source code 429]
[Speech recognition] BP neural network speech recognition based on the momentum item of matlab [Including Matlab source code 430]
[Voice steganography] based on matlab LSB voice hiding [including Matlab source code 431]
[Voice recognition] based on matlab male and female voice recognition [including Matlab source code 452]
[Voice processing] based on matlab voice noise adding and noise reduction processing [including Matlab source code Issue 473]
[Speech denoising] based on matlab least squares (LMS) adaptive filter [including Matlab source code 481]
[Speech enhancement] based on matlab spectral subtraction, least mean square and Wiener filter speech enhancement [including Matlab source code 482 period】
[Communication] based on matlab GUI digital frequency band (ASK, PSK, QAM) modulation simulation [including Matlab source code 483]
[Signal processing] based on matlab ECG signal processing [including Matlab source code 484]
[Voice broadcast] based on matlab voice Broadcast [Including Matlab source code 507]
[Signal processing] Matlab wavelet transform based on EEG signal feature extraction [Including Matlab source code 511]
[Voice processing] Based on matlab GUI dual tone multi-frequency (DTMF) signal detection [Including Matlab source code 512 】
【Voice steganography】based on matlab LSB to realize the digital watermark of speech signal 【Include Matlab source code 513】
【Speech enhancement】Speech recognition based on matlab matched filter 【Include Matlab source code 514】
【Speech processing】Based on matlab GUI voice Frequency domain spectrogram analysis [including Matlab source code 527]
[Speech denoising] based on matlab LMS, RLS algorithm voice denoising [including Matlab source code 528]
[Voice denoising] based on matlab LMS spectral subtraction voice denoising [including Matlab Source code issue 529]
[Voice denoising] based on matlab soft threshold, hard threshold, compromise threshold voice denoising [including Matlab source code 530]
[Voice recognition] based on matlab specific person's voice recognition discrimination [including Matlab source code 534]
[ Speech denoising] based on matlab wavelet soft threshold speech noise reduction [including Matlab source code 531]
[speech denoising] based on matlab wavelet hard threshold speech noise reduction [including Matlab source code 532]
[speech recognition] based on matlab MFCC and SVM specific Human gender recognition [including Matlab source code 533]
[Voice recognition] GMM speech recognition based on MFCC [including Matlab source code 535]
[Voice recognition] based on matlab VQ specific person isolated words voice recognition [including Matlab source code 536]
[Voice recognition] based on matlab GUI voiceprint recognition [including Matlab] Source code issue 537]
[Collection and reading] based on matlab voice collection and reading and writing [including Matlab source code 538]
[Voice editing] based on matlab voice editing [including Matlab source code 539]

Guess you like

Origin blog.csdn.net/TIQCmatlab/article/details/114953651