classdef Flanger< matlab.System
%Flanger Add flanging effect to audio signal.
%
%   FLANGER = audioexample.Flanger returns an flanger System object,
%   FLANGER, that adds flanging effect to the audio signal.
%
%   FLANGER = audioexample.Flanger('Name', Value, ...) returns a flanger
%   System object, FLANGER, with each specified property name set to the
%   specified value. You can specify additional name-value pair arguments
%   in any order as (Name1,Value1,...,NameN, ValueN).
%
%   Step method syntax:
%      
%   Y = step(FLANGER, X) adds flanging effect for the audio input X based
%   on the properties specified in the object FLANGER and returns it as
%   audio output Y. Each column of X is treated as individual channel of
%   input.
%
%   System objects may be called directly like a function instead of using
%   the step method. For example, y = step(obj, x) and y = obj(x) are
%   equivalent.
%
%   Flanger methods:
%
%   step     - See above for the description of the method
%   <a href="matlab:help matlab.System/reset   ">reset</a>    - Resets the internal state to initial conditions
%   clone    - Create Flanger system object with similar property values
%   isLocked - Locked status (logical)
%   
%   Flanger properties:
%   
%   Delay         - Base delay in seconds
%   Depth         - Amplitude of modulator
%   Rate          - Frequency of modulator
%   FeedbackLevel - Feedback gain
%   WetDryMix     - Wet to dry signal ratio
%   SampleRate    - Sample rate of the input audio signal   
%
%   % Example: Add chorus effect to an audio signal.
%
%   reader = dsp.AudioFileReader('SamplesPerFrame', 1024,...
%     'PlayCount', 3);
% 
%   player = audioDeviceWriter('SampleRate', reader.SampleRate);
% 
%   flanger = audioexample.Flanger;
% 
%   while ~isDone(reader)
%       Input = reader();
%       Output = flanger(Input);
%       player(Output);
%   end
% 
%   release(reader)
%   release(player)

 
% Copyright 2015-2016 The MathWorks, Inc.

    methods
        function out=Flanger
            % Set properties according to name-value pairs
        end

        function out=IsOutputComplexImpl(~) %#ok<STOUT>
        end

        function out=getOutputDataTypeImpl(~) %#ok<STOUT>
        end

        function out=getOutputSizeImpl(~) %#ok<STOUT>
        end

        function out=isOutputFixedSizeImpl(~) %#ok<STOUT>
        end

        function out=loadObjectImpl(~) %#ok<STOUT>
        end

        function out=processTunedPropertiesImpl(~) %#ok<STOUT>
            % When Delay property changes, we have recalculate
            % pDelayInSamples property. Note that to maintain similar data
            % types throughout the process, cast function is used.
        end

        function out=releaseImpl(~) %#ok<STOUT>
        end

        function out=resetImpl(~) %#ok<STOUT>
            % Reset the delay and sine wave objects
        end

        function out=saveObjectImpl(~) %#ok<STOUT>
        end

        function out=setupImpl(~) %#ok<STOUT>
        end

        function out=stepImpl(~) %#ok<STOUT>
            % Create the delay vector. Delay in samples are added to the
            % sine wave here.
        end

        function out=validateInputsImpl(~) %#ok<STOUT>
            % Validate inputs to the step method at initialization.
        end

    end
    properties
        %Delay Base delay
        %   Specify the base delay for flanger effect as positive scalar
        %   value in seconds. Base delay value must be in the range between
        %   0 and 0.1 seconds. The default value of this property is
        %   0.001.
        Delay;

        %Depth Amplitude of modulator
        %   Specify the amplitude of modulating sine wave as a positive
        %   scalar value. This sinewave is added to the base delay value to
        %   make the delay sinusoidally modulating. The value must range
        %   from 0 to 50. The default value of this property is 30.
        Depth;

        %FeedbackLevel Feedback gain value.
        %   Specify the feedback gain value as a positive scalar. This
        %   value must range from 0 to 1. Setting FeedbackLevel to 0 turns
        %   off the feedback path. The default value of this property is
        %   0.4.
        FeedbackLevel;

        %Rate Frequency of modulator
        %   Specify the frequency of the sine wave as a positive scalar
        %   value in Hz. This property controls the flanging rate. The
        %   value must range from 0 to 0.5 Hz. The default value of this
        %   property is 0.25.
        Rate;

        %SampleRate Sampling rate of input audio signal
        %   Specify the sampling rate of the audio signal as a positive
        %   scalar value.  The default value of this property is 44100 Hz.
        SampleRate;

        %WetDryMix Wet/dry mix
        %   Specify the wet/dry mix ratio as a positive scalar. This value
        %   ranges from 0 to 1. For example, for a value of 0.6, the ratio
        %   will be 60% wet to 40% dry signal (Wet - Signal that has effect
        %   in it. Dry - Unaffected signal). The default value of this
        %   property is 0.5.
        WetDryMix;

    end
end
