chowning.m

来自「很多matlab的源代码」· M 代码 · 共 37 行

M
37
字号
function y = chowning(t,fc,fm,e1,e2)
%CHOWNING FM synthesized note using Chowning's formula.
%	y =  chowning(t,fc,fm,e1,e2)
%	t=time array, fc=carrier freq, fm=modulating freq
%	e1 and e2 are envelopes produced by asr (Type help asr for details)
%	The output corresponds to
%	y=e1.*sin(2*pi*fc*t+e2.*sin(2*pi*fm*t))   Defaults: e1=1, e2=1
%
%	If no input arguments are given, the follwoing example is implemented
%
%	t1=(0:8191)/8192;[m1,m2]=asr(t1);y1=chowning(t1,400,3,m1,m2);sound(y1);



% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998



if nargin==0,help chowning, disp('strike a key to hear the example sound'),
pause,t1=(0:8191)/8192;[m1,m2]=asr(t1);
y1=chowning(t1,400,3,m1,m2);sound(y1);return,end



if nargin<5,e2=1;end
if nargin<4,e1=1;end

y=e1.*sin(2*pi*fc*t+e2.*sin(2*pi*fm*t));

⌨️ 快捷键说明

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