new_formant.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 59 行

M
59
字号
% Callback function for the new_formant pushbutton
% Creates default formants, that can then be modified according to need
% Original code for generating formants written by Albert Hsiao
% Author : Karthik 
%
% Modified by D. G. Childers 2/25/98
% 
if exist ('Nframe1')
   Nframe=Nframe1;
end

%Default formants and bandwidths

Ff=ones(Nframe,6);       % formant frequencies
Ff(:,1)=303*Ff(:,1);
Ff(:,2)=2172*Ff(:,2);
Ff(:,3)=2851*Ff(:,3);
Ff(:,4)=3572*Ff(:,4);
Ff(:,5)=3950*Ff(:,5);
Ff(:,6)=4500*Ff(:,6);

Fb=ones(Nframe,6);       % formant bandwidths
Fb(:,1)=120*Fb(:,1);
Fb(:,2)=160*Fb(:,2);
Fb(:,3)=285*Fb(:,3);
Fb(:,4)=347*Fb(:,4);
Fb(:,5)=720*Fb(:,5);
Fb(:,6)=4670*Fb(:,6);    % while this seems large it adds some nice spectral shaping

clc;

Ff1 = Ff ; %Make a copy
Fb1 = Fb ; %Make a copy

 PV = [436 204 244 81];
s2 = 'Formants have been created';
% Open analysis window
message_fig = figure('Position',PV,...
   'Numbertitle','off',...
   'Color',[0.5 0.5 0.5],...
   'Name',s2);
uicontrol('Style','Frame',...
   'Units','Normalized',...
   'Position',[0.05 0.05 0.9 0.9],...
   'BackGroundColor',[0.9 0.9 0.9]);

uicontrol('Style','text',...
   'Units','Normalized',...
   'Position',[0.1 0.2 0.8 0.4],...
   'ForegroundColor','red',...
   'BackGroundColor',[0.9 0.9 0.9],...
   'String','Default formants have been created. You may modify them now');
      
pause(3);
close(message_fig);
clear message_fig;

     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?