MATLAB语音信号分析与合成——MATLAB语音信号分析学习资料汇总(图书、代码和视频)

devtools/2024/9/22 18:14:56/

教科书:MATLAB语音信号分析与合成(第2版)

链接(含配套源代码):https://pan.baidu.com/s/1pXMPD_9TRpJmubPGaRKANw?pwd=32rf 
提取码:32rf

基础入门视频:

视频链接:

清华大学_信号处理与语音分析

配套练习:

任务:利用线性预测模型,寻找 汉语韵母 的共振峰
1 步:在安静的环境中,(建议用手机)录制声音
发音内容: a e i o u (“阿、婀、依、哦、乌”)
建议发音时尽量平稳、清晰
2 步:将一整段声音分为多帧,对每一帧 𝑥[𝑛] 进行 分析
使用 MATLAB 提供的 lpc 函数(或 levinson 函数),得到每一帧的
线性预测系数 𝑎 1 , ⋯ , 𝑎 𝑃 ,进而可得该帧的激励信号 𝑒[𝑛]
3 步:找到滤波器 1/𝐴(𝑧) 幅度谱的前两个共振峰频率值 𝑓 1 𝑓 2
4 步:画出每个韵母的共振峰频率值 𝑓 2 vs 𝑓 1 (横轴为 𝑓 1 ,纵轴为 𝑓 2

实验结果参考:

参考代码(需要对这个代码进行修改才能完成任务,这个代码也是清华老师刘奕汶给学生做这个实验提供的代码):

%% DSP_lab5_2024_LP_demo_rb_v0_1.m
% For the course EEG3024B: DSP Technology and Its Applications at Shantou University
% ZHANG Rongbin,  20 Apr 2024% Adapted based on ASAS_lab6_LinPred_2015.m by Prof. Yi-Wen Liu
% EE6641 HW: Linear prediction and Levinson-Durbin k-parameter estimation
% Created May 2013 as a homework.
% Last updated Nov 2015 for this year's Lab6 and HW3.
% Yi-Wen Liuclear; 
close all;DIR = './';FILENAME = 'a1.mp3';
% FILENAME = 'i1.mp3';[y, fs1] = audioread([DIR FILENAME]);
y = y(:, 1);  % Obtain the first channel in case the audio file has multiple channels
% figure; plot(y);y = y(60000 : end - 60000);
% figure; plot(y);soundsc(y, fs1);
fs = 16000;  % sampling frequency, in Hzy = resample(y, fs, fs1);%% Parameters to play with
framelen = 0.04; % Frame length, in second. Please try changing this.
p = 16; % linear prediction order. Please try changing this.%%
L = framelen*fs; % Frame length, in samplesif L <= pdisp('Linear prediction requires the num of equations to be greater than the number of variables.');
endsw.emphasis = 1; % default = 1  (Used to pre-emphasis the high frequency components)numFrames = floor(length(y)/L);
excitat = zeros(size(y));   % excitation signal 
e_n = zeros(p+L,1);LPcoeffs = zeros(p+1,numFrames);
Kcoeffs = zeros(p,numFrames); % reflection coeffsNfreqs = 1024; % Num points for plotting the inverse filter response
df = fs/2/Nfreqs;
ff = 0:df:fs/2-df;if sw.emphasis == 1y_emph = filter([1 -0.95],1,y);
elsey_emph = y;
endh = figure;
h_pos = h.Position; 
set(h, 'Position', [0.5*h_pos(1)   0.5*h_pos(2)   h_pos(3)*1.3   h_pos(4)*1.3]);%% Linear prediction and estimation of the source e_n
win = ones(L,1); % Rectangular window.
lpc_1_levinson_0 = 0;   % Indicator, 1 for using lpc() function, 0 for using levinson() function
for kk = 1:numFramesind = (kk-1)*L+1 : kk*L;ywin = y_emph(ind).*win;Y = fft(ywin, 2^nextpow2(2*size(ywin,1)-1));
% 	Y = fft(ywin, Nfreqs*2);if lpc_1_levinson_0 == 1%% Use MATLAB's lpc() functionA = lpc(ywin, p); %% This is actually the direct way to obtain the LP coefficients. else%% Or, use Levinson-Durbin algorithm% We can used levinson() instead because it gives us the "reflection coefficients". R = ifft(abs(Y).^2);[A, errvar, K] = levinson(R, p);endif kk == 1e_n(p+1 : end) = filter(A, [1], ywin);elseywin_extended = y((kk-1)*L+1-p : kk*L);e_n = filter(A, [1], ywin_extended);endexcitat(ind) = e_n(p+1 : end);if kk>1subplot(311);plot(ind/fs*1000, y(ind), 'b', 'LineWidth', 1.5);xlabel('Time (in ms)', 'Interpreter', 'latex', 'fontSize', 14);ylabel('$x(n)$', 'Interpreter', 'latex', 'fontSize',14);title('Time Domain: $x(n)$', 'Interpreter', 'latex', 'fontSize', 16);set(gca, 'xlim', [kk-1 kk]*framelen*1000);grid on;    ax = gca;         ax.GridLineStyle = '--';        grid minor; subplot(312);plot(ind/fs*1000, e_n(p+1:end), 'k', 'LineWidth', 1.5);xlabel('Time (in ms)', 'Interpreter', 'latex', 'fontSize', 14);ylabel('$e(n)$', 'Interpreter', 'latex', 'fontSize', 14);title('Time Domain: $e(n)$', 'Interpreter', 'latex', 'fontSize', 16);set(gca, 'xlim', [kk-1 kk]*framelen*1000);grid on;    ax = gca;         ax.GridLineStyle = '--';        grid minor; subplot(313);[H, W] = freqz(1, A, Nfreqs);Hmag = 20*log10(abs(H));Ymag = 20*log10(abs(Y(1:Nfreqs)));Hmax = max(Hmag);offset = max(Hmag) - max(Ymag);plot(ff, Ymag+offset, 'b', 'LineWidth', 1); hold on;plot(ff, Hmag, 'r', 'LineWidth', 3); hold off;if kk == numFrameslegend('$|X(\omega)|$ of $x(n)$', '$|A(\omega)|$ of LPC $\{ a_k \}$', ...'Location', 'NorthEast', 'Interpreter', 'latex', 'fontSize', 14);endset(gca, 'xlim', [0 fs/2], 'ylim', [Hmax-50, Hmax+5]);xlabel('Frequency (in Hz)', 'Interpreter', 'latex', 'fontSize', 14);title('Frequency Domain: $|X(\omega)|$ and $|A(\omega)|$', 'Interpreter', 'latex', 'fontSize', 16);ylabel('dB', 'Interpreter', 'latex', 'fontSize', 16);grid on;    ax = gca;         ax.GridLineStyle = '--';        grid minor; drawnow;endend% play the estimated source signal
soundsc(excitat, fs); % Typical values for the pitch period are 8 ms for male speakers, and 4 ms for female speakers.   ——《ECE438 DSP with Apps - Laboratory 9 - Speech Processing (Week 1).pdf》


http://www.ppmy.cn/devtools/22573.html

相关文章

【机器学习与流体力学交叉领域的期刊】

当涉及到机器学习与流体力学交叉领域的期刊时&#xff0c;以下是一些建议的期刊&#xff0c;这些期刊涵盖了机器学习和流体力学领域的最新研究和发展&#xff1a; Journal of Fluid Mechanics&#xff1a;这是流体力学领域的顶级期刊&#xff0c;虽然主要关注流体力学的理论、…

rabbitmq报错

文章目录 Applying plugin configuration to rabbitDESKTOP-C3HQ9BK... Plugin configuration unchanged.rabbitmq-service.bat start和rabbitmq-plugins enable rabbitmq_management这两个命令在RabbitMQ中具有不同的功能和用途。以下是两者之间的主要区别&#xff1a; Applyi…

【JavaEE网络】网络编程及其应用概述

目录 面向字节流粘包问题 TCP异常情况TCP/UDP对比 网络层重点协议IP协议IP地址 面向字节流 粘包问题 在面向字节流的情况下&#xff0c;会产生一些其他的问题&#xff1a;粘包问题&#xff0c;这里“粘”的是“应用层数据报”&#xff0c;通过TCP read/write的数据&#xff0…

Go语言在Web开发中有哪些常用框架?

文章目录 1. Gin原因和解决方案示例代码 2. Echo原因和解决方案示例代码 3. Revel原因和解决方案示例代码 4. Buffalo原因和解决方案示例代码 总结 Go语言在Web开发中拥有许多优秀的框架&#xff0c;这些框架帮助开发者快速构建稳定且高效的Web应用。下面是一些常用的Go语言Web…

LMDeploy 量化部署 LLM-VLM 实践 学习笔记

视频链接 https://www.bilibili.com/video/BV1tr421x75B/?vd_sourcea1ce254b4a97f9f687a83e661793cb2c 什么是模型部署 部署指的是已经开发好的大模型投入使用&#xff0c;要把模型部署到服务器或者移动端里&#xff0c;如何在有限的资源里加载大模型&#xff1f; 比如你好不…

Linux之进程间通信(二)

system V system V共享内存是内核中专门设计的通信的方式, 粗粒度划分操作系统分为进程管理, 内存管理, 文件系统, 驱动管理.., 粒度更细地分还有 进程间通信模块. 对于操作系统, 通信的场景有很多, 有以传送数据, 快速传送数据, 传送特定数据块, 进程间协同与控制以目的, 它…

2024最新版JavaScript逆向爬虫教程-------基础篇之深入JavaScript运行原理以及内存管理

目录 一、JavaScript运行原理1.1 前端需要掌握的三大技术1.2 为什么要学习JavaScript1.3 浏览器的工作原理1.4 浏览器的内核1.5 浏览器渲染过程1.6 认识JavaScript引擎1.7 V8引擎以及JavaScript的执行过程1.8 V8引擎执行过程 二、JavaScript的执行过程2.1 初始化全局对象2.2 执…

排序算法:插入、希尔、选择、推排、冒泡、快速、归并排序

排序算法 目录 前言 一、排序的概念 1.1排序的概念 1.2 常见的排序算法 二、常见排序算法的实现 2.1 插入排序 2.2 希尔排序 2.3 选择排序 2.4 堆排序 2.5 冒泡排序 2.6 快速排序 2.6.1 hoare版本 2.6.2 前后指针版本 2.6.3 非递归版本 2.7 归并排序 归并排序 2.8 计数排序 三、…