Code covered by the BSD License  

Highlights from
SigPlot

SigPlot

by

 

An advanced interface for 1-D signal visualization & editing.

VectorDataPlot_MappingFunction_AR(vector_data_plot_panel, vector_index, vector_data_plot_parameters)
% This is a mapping function meant to be used in sigplotVectorDataPlot 
%
% Usage 1: Initialization
%
%  [ name, parameters_value, parameters_definition ] = VectorDataPlot_MappingFunction_AR(vector_data_plot_panel);
%
% Usage 2: Visualization
%
%  [ vec ] = VectorDataPlot_MappingFunction_AR(vector_data_plot_panel, vector_index, vector_data_plot_parameters)
%
function [ varargout ] = VectorDataPlot_MappingFunction_AR(vector_data_plot_panel, vector_index, vector_data_plot_parameters)
sample_rate = vector_data_plot_panel.GetSampleRate();
if (nargin == 1)
    name = 'AutoRegressive';
    % The parameters that control the usage of the function.
    parameters_value = struct( ...
        'MinFreq', 0 ,...
        'MaxFreq', sample_rate/2,...
        'CallbackFcn', 'VectorDataPlot_MappingFunction_AR' ...
        );
    % The parameters used by ParamEditor to edit these parameters.
    parameters_definition = struct( ...
        'InfoTxt', 'Auto-Regressive Coefficients', ...
        'MinFreq', [], ...
        'MaxFreq', [], ...
        'WarpFactor', [], ...
        'CallbackFcn', [] ...
        );    
    parameters_definition.MinFreq.InfoTxt = 'Min. freq. display';
    parameters_definition.MinFreq.Range = [ 0 sample_rate/2 ];
    parameters_definition.MaxFreq.InfoTxt = 'Max. freq. display';
    parameters_definition.MaxFreq.Range = [ 0 sample_rate/2 ];
    parameters_definition.CallbackFcn.InfoTxt = 'Callback function';
    parameters_definition.CallbackFcn.Range = [ ];
    
    varargout{1} = name;
    varargout{2} = parameters_value;
    varargout{3} = parameters_definition;
else
    ar = lsf2poly(vector_data_plot_panel.panel_data.Vec(:, vector_index)*2*pi/sample_rate);
    vec = freqz(1, ar, vector_data_plot_parameters.freq, sample_rate);
    vec = 20*log10(abs(vec));
    
    varargout{1} = vec;
end

Contact us