Home > matlabpr > Demo1D.m

Demo1D

PURPOSE ^

Demo1D.m --- One-dimensional W-model, K-model, and hybrid model demo.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Demo1D.m --- One-dimensional W-model, K-model, and hybrid model demo.

 This script demonstrates different 1D modeling schemes, desribed in the paper
 Digital Waveguides versus Finite Difference Structures: Equivalence and Mixed
 Modeling, Matti Karjalainen and Cumhur Erkut. EURASIP J. of Applied Signal
 Processing, Volume 2004, Number 7, pp. 978-989, 15 June 2004.

%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Matlab -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author          : Cumhur.Erkut@erase.hut.fi
% Created On      : Thu Jul 01 12:55:22 2004
% Last Modified By: Cumhur.Erkut@erase.hut.fi
% Last Modified On: Thu Jul 01 15:12:17 2004
% Update Count    : 118
% Reference       : Digital Waveguides versus Finite Difference Structures: 
%                   Equivalence and Mixed Modeling, Matti Karjalainen and
%                   Cumhur Erkut. EURASIP J. of Applied Signal Processing,
%                   Volume 2004, Number 7, pp. 978-989, 15 June 2004.
%                   http://asp.hindawi.com/volume-2004/S1110865704401176.html
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Demo1D.m --- One-dimensional W-model, K-model, and hybrid model demo.
0002 %
0003 % This script demonstrates different 1D modeling schemes, desribed in the paper
0004 % Digital Waveguides versus Finite Difference Structures: Equivalence and Mixed
0005 % Modeling, Matti Karjalainen and Cumhur Erkut. EURASIP J. of Applied Signal
0006 % Processing, Volume 2004, Number 7, pp. 978-989, 15 June 2004.
0007 %
0008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Matlab -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0009 %% Author          : Cumhur.Erkut@erase.hut.fi
0010 %% Created On      : Thu Jul 01 12:55:22 2004
0011 %% Last Modified By: Cumhur.Erkut@erase.hut.fi
0012 %% Last Modified On: Thu Jul 01 15:12:17 2004
0013 %% Update Count    : 118
0014 %% Reference       : Digital Waveguides versus Finite Difference Structures:
0015 %%                   Equivalence and Mixed Modeling, Matti Karjalainen and
0016 %%                   Cumhur Erkut. EURASIP J. of Applied Signal Processing,
0017 %%                   Volume 2004, Number 7, pp. 978-989, 15 June 2004.
0018 %%                   http://asp.hindawi.com/volume-2004/S1110865704401176.html
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 clc;
0022 help Demo1D
0023 disp('Press any key...')
0024 pause
0025 
0026 clc;
0027 sprintf(['First create an excitation signal to be fed in node N1 \n(see Figure ' ...
0028          '2 or Figure 3 of the paper). The length of the excitation \n' ...
0029          'determines the length of the animations that follow.\n'])
0030 echo on
0031 Uext = [1 zeros(1,399)]; % Impulse
0032 
0033 echo off;
0034 disp('Press any key...')
0035 pause
0036 
0037 sprintf(['Now set the model parameters.' ...
0038         '\nThe admittances should be positive-real.'...
0039         ])
0040 echo on
0041 Y1 = 0.05; % Left HS termination admittance.
0042 Y2 = 1.00; % Characteristic admittance of the W-line or K-pipe.
0043 YN = 0.10; % Right HS termination admittance.
0044  N = 50;   % Number of total nodes.
0045  
0046 echo off;
0047 disp('Press any key...')
0048 pause
0049 
0050 fIDX = 1;
0051 help wmodel;
0052 sprintf('\nPress any key to see the W-model animation in Figure(%d) ...',fIDX)
0053 pause
0054 echo on
0055 PW = wmodel(Uext,Y1,Y2,N,YN,fIDX);
0056 echo off
0057 disp('Press any key...');pause
0058 
0059 fIDX = 2;
0060 help kmodel;
0061 sprintf('\nPress any key to see the K-model animation in Figure(%d)...',fIDX)
0062 pause
0063 echo on
0064 PK = kmodel(Uext,Y1,Y2,N,YN,fIDX);
0065 echo off
0066 disp('Press any key...');pause
0067 
0068 fIDX = 3;
0069 help hybridmodel;
0070 sprintf(['\nPress any key to see the hybrid model animation in Figure(%d).\n', ...
0071         'After the animation, the positions of K-model, W-model, and \n',...
0072         'KW-Converter will be indicated ...'],fIDX)
0073 pause
0074 echo on
0075 PH = hybridmodel(Uext,Y1,Y2,N,YN,fIDX);
0076 echo off
0077 disp('Press any key...');pause
0078 
0079 sprintf(['The pressures PW,PK, and PH, calculated by W-,K-, and hybrid \n' ...
0080          'models, respectively, should be equal. This may be verified \n' ...
0081          'by plotting them. This basic demonstration serves as a guideline \n' ...
0082          'to experiment with the models. Happy experimentation!'])

Generated on Thu 01-Jul-2004 15:38:41 by m2html © 2003