【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】

⛄一、简介

1 滤波
滤波是对信号中特定频段的频率进行滤波的操作,是抑制和防止干扰的重要措施。它是根据观察一个随机过程的结果来估计另一个相关的随机过程的概率理论和方法。

[En]

Filtering is the operation of filtering the frequency of a specific band in the signal, and it is an important measure to restrain and prevent interference. It is a probability theory and method to estimate another related random process according to the results of observing a random process.

过滤分为经典过滤和现代过滤。

[En]

Filtering is divided into classical filtering and modern filtering.

经典滤波:
经典滤波的概念是一个基于傅里叶分析和变换的工程概念。根据高等数学理论,任何满足一定条件的信号都可以看作是无限正弦波的叠加。换句话说,工程信号是由不同频率的正弦波线性叠加而成,组成信号的不同频率的正弦波称为信号的频率分量或谐波分量。

[En]

The concept of classical filtering is an engineering concept based on Fourier analysis and transform. According to the theory of higher mathematics, any signal that satisfies certain conditions can be regarded as the superposition of infinite sine waves. In other words, the engineering signal is formed by the linear superposition of sine waves of different frequencies, and the sine waves of different frequencies that make up the signal are called the frequency components or harmonic components of the signal.

滤波器:
只允许某一频率范围内的信号分量正常通过,并组织另一部分频率分量通过的电路。它被称为经典滤波器或滤波电路。事实上,任何电子系统都有自己的带宽(对信号最高频率的限制),频率特性反映了电子系统的这一基本特征。该滤波器是根据电路参数对电路频带宽度的影响而设计的工程应用电路。

[En]

A circuit that only allows signal components within a certain frequency range to pass normally and organizes another part of the frequency components to pass through. It’s called a classical filter or filter circuit. In fact, any electronic system has its own band width (the restriction on the highest frequency of the signal), and the frequency characteristic reflects this basic characteristic of the electronic system. The filter is an engineering application circuit designed according to the influence of circuit parameters on the frequency band width of the circuit.

现代滤波
用模拟电子电路对模拟信号进行滤波的基本原理是利用电路的频率特性来选择信号的频率分量。根据频率滤波,将信号视为不同频率的正弦波叠加形成的模拟信号,通过选择不同的频率分量来实现信号滤波。

[En]

The basic principle of filtering the analog signal with the analog electronic circuit is to select the frequency components of the signal by using the frequency characteristics of the circuit. According to the frequency filtering, the signal is regarded as an analog signal formed by the superposition of sine waves of different frequencies, and the signal filtering is realized by selecting different frequency components.

1、当允许信号中较高频率的成分通过滤波器时,这种滤波器叫做高通滤波器。
2、当允许信号中较低频率的成分通过滤波器时,这种滤波器叫做低通滤波器。
3、设低频段的截止频率为fp1,高频段的截止频率为fp2:
1)频率在fp1与fp2之间的信号能通过其它频率的信号被衰减的滤波器叫做带通滤波器。
2)反之,频率在fp1到fp2的范围之间的被衰减,之外能通过的滤波器叫做带阻滤波器。
理想滤波器的特性通常用幅频特性图来描述,也称为滤波电路的幅频特性。

[En]

The behavior of the ideal filter is usually described by the amplitude-frequency characteristic diagram, which is also called the amplitude-frequency characteristic of the filter circuit.

2 傅里叶变换
傅里叶变换是一种积分变换,是一种从时间到频率的变换。傅立叶原理表明,任何连续测量的时间序列或信号都可以表示为不同频率的正弦波信号的无限叠加。可以说,傅里叶变换将难以处理的时域信号转换为易于分析的频率信号(信号的频谱)。

[En]

Fourier transform is a kind of integral transform, which is a change from time to frequency. The Fourier principle shows that any continuously measured time series or signal can be expressed as the infinite superposition of sine wave signals of different frequencies. It can be said that the Fourier transform converts the time domain signal which is difficult to deal with into the frequency signal (the frequency spectrum of the signal) which is easy to analyze.

图像的频率是图像中灰度级急剧变化(个体心理中知识的反映和存在)的指标,是平面空间中灰度级的梯度。图像是灰度变化缓慢的区域,对应的频率值很低,反之亦然。

[En]

The frequency of the image is an index of the sharp change of gray level in the image (the reflection and existence of knowledge in individual psychology), and it is the gradient of gray level in plane space. The image is an area where the gray level changes slowly, and the corresponding frequency value is very low, and vice versa.

在纯粹的数学意义上,傅里叶变换将一个函数变换成一系列周期函数。从物理效果来看,傅里叶变换是将图像从空间域变换到频域,逆变换是将图像从频域变换到空间域。也就是说,傅里叶变换的物理意义是将图像的灰度分布函数变换为图像的频率分布函数,傅里叶逆变换是将图像的频率分布函数变换为灰度分布函数。

[En]

In a purely mathematical sense, Fourier transform transforms a function into a series of periodic functions. From the physical effect, the Fourier transform is to transform the image from the spatial domain to the frequency domain, and the inverse transform is to convert the image from the frequency domain to the spatial domain. In other words, the physical meaning of Fourier transform is to transform the gray distribution function of the image into the frequency distribution function of the image, and the inverse Fourier transform is to transform the frequency distribution function of the image into the grayscale distribution function.

3 傅里叶变换的性质
平移性质

【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
1
2
公式(1)表明将f(x,y)与一个指数项相乘就相当于把其变换后的频域中心移动到新的位置
公式(2)表明将F(u,v)与一个指数项相乘就相当于把其变换后的空域中心移动到新的位置
公式(2)表明对f(x,y)的平移不影响其傅里叶变换的幅值
分配率
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】

; ⛄二、部分源代码

clear all
close
clc;
disp(‘正在计算参考模板的参数…’)
for i=1:10
fname=sprintf(‘%d0.mp3’,i-1);
[x,fs]=audioread(fname);
sound(x,fs);
[x1 x2]=vad(x);
% x1=abs(round(x1));
% x2=abs(round(x2));
m=mfcc(x);
m=m(x1-2:x2-4,:);
ref(i).mfcc=m;
end

disp(‘正在分析语音信号…’)
for i=1:10
fname=sprintf(‘%d0.mp3’,i-1);
%[x,fs,bit]=audioread(fname,[2000,2512]); %采样%
[x,fs]=audioread(fname,[2000,2512]);
%sound(x,fs); %播放语音信号
figure(i);
subplot(3,3,1);
plot(x(1:256)); %原始语音信号的时域图形%
title(‘原始信号’)
subplot(3,3,2)
[h,w]=freqz(x,fs); %原始语音信号的频率响应图
hr=abs(h); %求系统幅频响应
plot(w,hr);
title(‘幅频图’);
xlabel(‘Frequency in rad mple’)
ylabel(‘Magnitude in dB’)
subplot(3,3,3)
hphase=angle(h);
hphase=unwrap(hphase); %求系统相频响应
plot(w,hphase);
title(‘相频图’);
xlabel(‘Frequency in rad mple’)
ylabel(‘Phase in degrees’)
y=fft(x,512); %傅立叶变换%
mag=abs(y);
mag1=10 log10(mag);
f=fs
(0:255)/512;
subplot(3,3,4)
plot(f,mag(1:256)); %FFT频谱图 %
title(‘fft变换后信号’)
iff=ifft(y,512); %反傅立叶变换%
ifm=abs(iff);
subplot(3,3,5)
plot(f,ifm(1:256))
title(‘ifft后信号’)
% 短时傅里叶变换
Ts=1/fs;
%N=T/Ts;
N=512;
Nw=20; %窗函数长
L=Nw/2; %窗函数每次移动的样点数
Tn=(N-Nw)/L+1; %计算把数据x共分成多少段
nfft=32;%FFT的长度
Tn=round(Tn);
TF=zeros(Tn,nfft); %将存放三维谱图,先清零
for i=1:Tn
xw=x((i-1) _10+1:i_10+10); %取一段数据
temp=fft(xw,nfft); %FFT变换
temp=fftshift(temp); %频谱以0频为中心
for j=1:nfft
TF(i,j)=temp(j); %把谱图存放在TF中
end
end
subplot(3,3,6)
fnew=((1:nfft)-nfft/2)*fs/nfft;
tnew=(1:Tn) _L_Ts;
[F,T]=meshgrid(fnew,tnew);
mesh(F,T,abs(TF))
title(‘短时傅立叶变换时频图’)
subplot(3,3,7)
contour(F,T,abs(TF))
title(‘等高线表示’)
end
function cost=testdtw(t,r)
[r1,c1]=size(t);
[r2,c2]=size®;
distance=zeros(r1,r2);
for n=1:r1
for m=1:r2
tr=(t(n,:)-r(m,:)).^2;
distance(n,m)=sqrt(sum(tr)/c1);
%distance(n,m)=sqrt(sum(tr)/c1);
end
end
D=zeros(r1,1);
function f=enframe(x,win,inc)
nx=length(x(😃);
nwin=length(win);
if (nwin == 1)
len = win;
else
len = nwin;
end
if (nargin < 3)
inc = len;
end
function cost=Idtw(t,r)
[r1,c1]=size(t);
[r2,c2]=size®;
distance=zeros(r1,r2);
for n=1:r1
for m=1:r2
tr=(t(n,:)-r(m,:)).^2;
distance(n,m)=sqrt(sum(tr)/c1);
%distance(n,m)=sqrt(sum(tr)/c1);
end
end

⛄三、运行结果

【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】
【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】

; ⛄四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,2019.

[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,2019.

3 备注
本部分摘录自互联网,仅供参考,如有侵权,请联系删除

[En]

Brief introduction this part is extracted from the Internet, for reference only, if infringement, contact to delete

Original: https://blog.csdn.net/TIQCmatlab/article/details/114021259
Author: 海神之光
Title: 【语音识别】基于matlab傅立叶变换0-9数字语音识别【含Matlab源码 384期】

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/526888/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球