classdef PeakFinderSpecification< AbstractMeasurementsSpecification
%PeakFinderSpecification Peak finder properties for the Spectrum
%Analyzer.
% PeakFinderSpecification contains the properties used by the Spectrum
% Analyzer PeakFinder property. Peak finder computes and displays the
% largest calculated peak values.
%
% PeakFinderSpecification properties:
%
%   MinHeight       - Level above which peaks are detected
%   NumPeaks        - Maximum number of peaks to show
%   MinDistance     - Minimum number of samples between adjacent peaks
%   Threshold       - Minimum height difference between peak and its
%                     neighboring samples
%   LabelFormat     - Coordinates to display next to the calculated
%                     peak value
%   Enable          - Enable peak finder measurement
%
% % EXAMPLE 1: Use peak finder with dsp.SpectrumAnalyzer System
% % object scope
% sine = dsp.SineWave('Frequency',[98 100],'SampleRate',1000);
% sine.SamplesPerFrame = 1024;
% scope = dsp.SpectrumAnalyzer('SampleRate',sine.SampleRate, ...
%     'PlotAsTwoSidedSpectrum',false,'ShowLegend',true);
%
% % Enable peak finder measurement
% scope.PeakFinder.Enable = true;
%
% % Set peak finder NumPeaks property
% scope.PeakFinder.NumPeaks = 4;
%
% for i=1:100
%     scope(sine() + 0.05*randn(1024,2));
% end
%
% release(scope);
%
% % EXAMPLE 2: Use peak finder with Spectrum Analyzer block
% % Create a model based on 'dsp_basic_filter' template
% [~,mdl] = fileparts(tempname);
% open_system(new_system(mdl,'FromTemplate','dsp_basic_filter'));
% saBlock = find_system(mdl,'BlockType','SpectrumAnalyzer');
%
% % Enable peak finder measurement
% scopeConfig = get_param(saBlock{1},'ScopeConfiguration');
% scopeConfig.PeakFinder.Enable = true;
%
% % Set peak finder NumPeaks property
% scopeConfig.PeakFinder.NumPeaks = 4;
%
% % Run simulation
% sim(mdl,'StopTime','20');

     
    %   Copyright 2018 The MathWorks, Inc.

    methods
        function out=PeakFinderSpecification
            %PeakFinderSpecification Construct the PeakFinderSpecification
            %class.
        end

        function getDefaultMeasurementsSpec(in) %#ok<MANU>
        end

        function getMeasurementUpdatedEventName(in) %#ok<MANU>
        end

        function getPropertyGroups(in) %#ok<MANU>
            % This method is used to selectively display public properties
            % based on values of other properties.
        end

        function set(in) %#ok<MANU>
            % Overload set() to enable tab completion of string property
            % values
        end

        function setupMeasurementObject(in) %#ok<MANU>
        end

    end
    properties
        %LabelFormat Coordinates to display next to the calculated peak
        %value
        %   Specify the label format as one of 'X' | 'Y' | 'X + Y'. The
        %   default LabelFormat is 'X + Y'.
        LabelFormat;

        MeasurerName;

        %MinDistance Minimum number of samples between adjacent peaks
        %   Specify the minimum peak distance as a positive real scalar.
        %   The default MinDistance value is 1.
        MinDistance;

        %MinHeight Level above which peaks are detected
        %   Specify the minimum peak height as a scalar value. The default
        %   MinHeight value is -Inf.
        MinHeight;

        %NumPeaks Maximum number of peaks to show
        %   Specify the number of peaks as a positive integer scalar less
        %   than 100. The default NumPeaks value is 3.
        NumPeaks;

        %Threshold Minimum height difference between peak and its
        %neighboring samples
        %   Specify the threshold as a nonnegative real scalar. The default
        %   Threshold value is 0.
        Threshold;

    end
end
