⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dspmain.asv

📁 DSP程序 Matlab是一套用于科学工程计算的可视化高性能语言与软件环境。它集数值分析、矩阵运算、信号处理和图形显示于一体
💻 ASV
📖 第 1 页 / 共 3 页
字号:
function f_dsp         

% F_DSP: Driver module for FDSP Toolbox
%
% Usage: f_dsp
%
% Version: 1.0
%
% Description: 
%
%   This MATLAB software is a supplement to the text 
%   "Fundamentals of Digital Signal Processing Using 
%   MATLAB" by R. J. Schilling and S. L, Harris, 
%   Brooks/Cole: Pacific Grove, CA, 2005. It is 
%   designed to allow users to run the chapter GUI 
%   modules and MATLAB examples, reproduce text figures,
%   and display solutions to selected problems. It also
%   provides the user with online help with the GUI 
%   modules and toolbox functions.
%
% Menu options:
%
%   1. GUI modules
%   2. Examples
%   3. Figures
%   4. Problems
%   5. Help
%   6. Web
%   7. Exit
%
% GUI simulation modules:
%
%   g_sample      => signal sampling 
%   g_reconstruct => signal reconstruciton 
%   g_system      => discrete-time linear systems 
%   g_spectra     => spectral analysis of signals 
%   g_correlate   => signal correlation and convolution 
%   g_filters     => filter specifications and structures
%   g_fir         => FIR filter design 
%   g_multirate   => multirate signal processing 
%   g_iir         => IIR filter design 
%   g_adapt       => adaptive signal processing 
%
% Main program support functions:
%
%   f_caliper   => measure points on graph with crosshairs
%   f_clip      => clip value to an interval
%   f_getsnd    => record sound from a microphone
%   f_labels    => draw axis labels and title for plot
%   f_prompt    => prompt for a number in a specified range
%   f_randg     => Gaussian random matrix A
%   f_randu     => uniformly distributed random matrix A
%   f_version   => MATLAB and FDSP version numbers
%   f_wait      => display a message and pause 
%  
% Chapter 1: Signal processing functions:
%
%   f_adc       => analog-to-digital conversion
%   f_dac       => digital-to-analog conversion 
%   f_quant     => quantization operator
%   f_freqs     => continuous-time frequency response  
%
% Chapter 2: Discrete-time systems analysis functions:
%
%   f_freq      => exact discrete-time frequency response
%   f_impulse   => impulse response
%   f_pzplot    => pole-zero sketch
%   f_pzsurf    => plot transfer function magnitude surface
%   f_spec      => signal spectra 
%
% Chapter 3: The DFT and spectral analysis functions:
%
%   f_freqz      => discrete-time frequency response using DFT
%   f_pds        => estimated power density spectrum
%   f_specgram   => signal spectrogram
%   f_unscramble => convert FFT output to range [-fs/2,fs/2]
%   f_window     => data windows
%
% Chapter 4: Convolution and correlation functions:
%
%   f_conv      => fast linear and circular convolution
%   f_corr      => fast linear and circular correlation 
%   f_blockconv => fast linear block convolution 
%
% Chapter 5: Filter specifications and structures functions:
%
%   f_cascade  => find cascade form realization (IIR)
%   f_filtlat  => lattice form filter output (FIR)
%   f_filtcas  => cascade form filter output (IIR)
%   f_filtpar  => parallel form filter output (IIR)
%   f_lattice  => find lattice form realization (FIR)
%   f_minall   => minimum-phase decompostion (IIR)
%   f_parallel => find parallel form realization (IIR)
%   
% Chapter 6: FIR filter design functions:
%
%   f_firamp   => frequency-selective amplitude response
%   f_firideal => design basic windowed FIR filter
%   f_firls    => design least-squares FIR filter
%   f_firsamp  => design frequency-sampled FIR filter
%   f_firwin   => design custom windowed FIR filter
%   f_firparks => design Parks-McLellen equiripple FIR filter
%   
% Chapter 7: Multirate signal processing functions:
%
%   f_decimate => sampling rate converter
%   f_interpol => sampling rate converter
%   f_rateconv => sampling rate converter
%
% Chapter 8: IIR filter design functions:
%
%   f_bilin     => bilinear transformation IIR design
%   f_butterz   => design Butterworth digital filter
%   f_cheby1z   => design Chebyshev-I digital filter
%   f_cheby2z   => design Chebyshev-II digital filter
%   f_ellipticz => design elliptic digital filter
%   f_iircomb   => design IIR comb filter
%   f_iirinv    => design IIR inverse comb filter
%   f_iirnotch  => design IIR notch filter
%   f_iirres    => design IIR resonator filter
%   f_low2bps   => analog lowpass to bandpass transformation
%   f_low2bss   => analog lowpass to bandstop transformation
%   f_low2highs => analog lowpass to highpass transformation
%   f_low2lows  => analog lowpass to lowpass transformation
%   f_reverb    => reverb filter
%   f_string    => plucked string filter
%
% Chapter 9: Adaptive signal processing functions:
%
%   f_lms        => least mean square (LMS) method
%   f_normlms    => normalized LMS method
%   f_corrlms    => correlation LMS method
%   f_leaklms    => leaky LMS method
%   f_fxlms      => filtered-x LMS method
%   f_rls        => recursive least squares (RLS) method
%   f_sigsyn     => signal synthesis method
%   f_rbfw       => RBF network training algorithm
%   f_rbf0       => RBF network output (raised-cosine)
%   f_state      => state vector of discrete-time system
%
% See also: 
%           G_SAMPLE G_RECONSTRUCT G_SYSTEM G_SPECTRA
%           G_CORRELATE G_FILTERS G_FIR G_MULTIRATE G_IIR
%           G_ADAPT   
  
% Programming notes:

% 1. In MATLAB 7, the Quit option activates prematurely when scanned
%    from the left after a click.
% 2. In MATLAB 7, the first time helpwin is called, it goes to the
%    standard MATLAB help, not the file specified. 

% Check MATLAB version

clc
clear all
if f_oldmat;
   return
end

% Initialize

instructor = 0;                          % Separate CD needed for this!
fdsp_version = f_version('FDSP');
matlab_version = f_version('MATLAB');
num_chap = 9;

fdsp_guis = ...
[
'g_sample       g_sample     '
'g_reconstruct  g_reconstruct'
'g_system       g_system     '
'g_spectra      g_spectra    '
'g_correlate    g_correlate  '
'g_filters      g_filters    '
'g_fir          g_fir        '
'g_multirate    g_multirate  '
'g_iir          g_iir        ' 
'g_adapt        g_adapt      ' 
];
[num_guis,m] = size(fdsp_guis);
guis = fdsp_guis(:,1:13);

fdsp_exam = ...
[
'exam1_10 Example 1.10    Successive approximation              '
'exam1_12 Example 1.12    Anti-aliasing filter design           '
'                                                               '
'exam2_15 Example 2.15    Zero-state response                   ' 
'exam2_18 Example 2.18    Comb filter                           ' 
'exam2_20 Example 2.20    Impulse response                      ' 
'exam2_21 Example 2.21    Convolution                           ' 
'exam2_26 Example 2.26    Frequency response                    '
'exam2_27 Example 2.27    Steady-state response                 '
'exam2_28 Example 2.28    Home mortgage                         '
'exam2_29 Example 2.29    Satellite attitude control            '
'exam2_30 Example 2.30    The Fibonacci sequence                '
'                                                               '
'exam3_1  Example 3.1     Spectrum of causual exponential       ' 
'exam3_7  Example 3.7     Uniform white noise                   ' 
'exam3_8  Example 3.8     Gaussian white noise                  ' 
'exam3_9  Example 3.9     Discrete frequency response           ' 
'exam3_10 Example 3.10    Zero padding                          ' 
'exam3_11 Example 3.11    Frequency resolution                  ' 
'exam3_12 Example 3.12    Bartlett''s method: white noise        ' 
'exam3_13 Example 3.13    Bartlett''s method: periodic input     ' 
'exam3_14 Example 3.14    Welch''s method: noisy periodic input  ' 
'exam3_15 Example 3.15    Spectrogram                           ' 
'exam3_16 Example 3.16    Signal detection                      ' 
'exam3_17 Example 3.17    Distortion due to clipping            ' 
'                                                               '
'exam4_6  Example 4.6     Fast convolution                      ' 
'exam4_7  Example 4.7     Fast block convolution                ' 
'exam4_8  Example 4.8     Linear cross-correlation              ' 
'exam4_9  Example 4.9     Fast linear correlation               ' 
'exam4_10 Example 4.10    Power density spectrum                ' 
'exam4_11 Example 4.11    Period estimation                     ' 
'exam4_12 Example 4.12    Periodic signal extraction from noise ' 
'exam4_13 Example 4.13    Echo detection                        ' 
'exam4_14 Example 4.14    Speech analysis and pitch             ' 
'                                                               '
'exam5_1  Example 5.1     Linear design specifications          ' 
'exam5_2  Example 5.2     Logarithmic design specifications (dB)' 
'exam5_5  Example 5.5     Minimum-phase filter                  ' 
'exam5_6  Example 5.6     Minimum-phase decomposition           ' 
'exam5_7  Example 5.7     FIR cascade form                      ' 
'exam5_8  Example 5.8     FIR lattice form                      ' 
'exam5_9  Example 5.9     IIR parallel form                     ' 
'exam5_10 Example 5.10    IIR cascade form                      ' 
'exam5_11 Example 5.11    Input quantization noise              ' 
'exam5_12 Example 5.12    FIR coefficient quantization error    ' 
'exam5_13 Example 5.13    FIR overflow and scaling              ' 
'exam5_14 Example 5.14    IIR coefficient quantization          ' 
'exam5_15 Example 5.15    IIR overflow and scaling              ' 
'exam5_16 Example 5.16    Limit cycle                           ' 
'exam5_17 Example 5.17    Highpass elliptic filter              '
'                                                               ' 
'exam6_1  Example 6.1     Truncated impulse response filter     ' 
'exam6_2  Example 6.2     Windowed lowpass fitlers              ' 
'exam6_3  Example 6.3     Windowed bandpass filter              ' 
'exam6_4  Example 6.4     Frequency-sampled lowpass filter      ' 
'exam6_5  Example 6.5     Filter with transition band sample    ' 
'exam6_6  Example 6.6     Optimal transition band sample        ' 
'exam6_7  Example 6.7     Least-squares bandpass filter         ' 
'exam6_8  Example 6.8     Equiripple filter                     ' 
'exam6_9  Example 6.9     Differentiator                        ' 
'exam6_10 Example 6.10    Hilbert transformer                   ' 
'exam6_11 Example 6.11    FIR bandstop filter design            '
'                                                               '
'exam7_1  Example 7.1     Integer decimator                     ' 
'exam7_2  Example 7.2     Integer interpolator                  ' 
'exam7_3  Example 7.3     Rational sampling rate converter      ' 
'exam7_6  Example 7.6     Multirate narrowband filter           ' 
'exam7_7  Example 7.7     Signal synthesis                      ' 
'exam7_8  Example 7.8     Oversampling ADC                      ' 
'exam7_9  Example 7.9     Oversampling DAC                      ' 
'exam7_10 Example 7.10    CD-to-DAT sampling rate converter     ' 
'                                                               '
'exam8_1  Example 8.1     Resonator filter                      ' 
'exam8_2  Example 8.2     Notch filter                          ' 
'exam8_3  Example 8.3     Filter design parameters              ' 
'exam8_4  Example 8.4     Butterworth filter                    ' 
'exam8_5  Example 8.5     Butterworth transfer function         ' 
'exam8_6  Example 8.6     Chebyshev-I filter                    ' 
'exam8_7  Example 8.7     Elliptic filter                       ' 
'exam8_8  Example 8.8     Bilinear transformation method        ' 
'exam8_10 Example 8.10    Digital bandpass filter               ' 
'exam8_11 Example 8.11    Reverb filter                         ' 
'                                                               '
'exam9_1  Example 9.1     Optimal weight vector                 ' 
'exam9_3  Example 9.3     System identification                 ' 
'exam9_7  Example 9.7     Excess mean square error              ' 
'exam9_8  Example 9.8     Normalized LMS method                 ' 
'exam9_9  Example 9.9     Correlation LMS method                ' 
'exam9_10 Example 9.10    Leaky LMS method                      ' 
'exam9_11 Example 9.11    Adaptive FIR filter design            ' 
'exam9_12 Example 9.12    Adaptive linear-phase FIR filter      ' 
'exam9_13 Example 9.13    RLS method                            ' 
'exam9_14 Example 9.14    FXLMS method                          ' 
'exam9_15 Example 9.15    Signal-synthesis method               ' 
'exam9_17 Example 9.17    Raised-cosine RBF                     ' 
'exam9_18 Example 9.18    Constant interpolation property       ' 
'exam9_19 Example 9.19    Nonlinear system identification       ' 
'exam9_20 Example 9.20    Identification of a chemical process  ' 
];

fdsp_fig = ...
[
'fig1_4   Figure 1.4      Magnitude response of a notch filter                 '
'fig1_6   Figure 1.6      Error signal with active noise control               '
'fig1_7   Figure 1.7      A continuous-time signal x_a(t)                      '
'fig1_8   Figure 1.8      A discrete-time signal x(k)                          '
'fig1_9   Figure 1.9      Quantizer input-output characteristic                '
'fig1_10  Figure 1.10     A digital signal x_q(k)                              '
'fig1_11  Figure 1.11     Unit impulse and unit step                           '
'fig1_15  Figure 1.15     Impulse response of an ideal lowpass filter          '
'fig1_17  Figure 1.17     Sampled signal using impulse sampling                '
'fig1_18  Figure 1.18     Sampled spectrum with aliasing                       '
'fig1_19  Figure 1.19     Common samples of two bandlimited signals            '
'fig1_20  Figure 1.20     Sampled spectrum with no aliasing                    '
'fig1_23  Figure 1.23     Impulse response of a zero-order hold filter         '
'fig1_24  Figure 1.24     Signal reconstruction with a zero-order hold         '
'fig1_27  Figure 1.27     Butterworth filter magnitude responses               '
'fig1_30  Figure 1.30     Magnitude response of a zero-order hold              '

⌨️ 快捷键说明

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