%% Logarithmic Parameter Mapping
% The following class definition uses logarithmic parameter mapping to define the relationship between a property and a parameter. You can use the plugin created from this class to tune the center frequency of a single-band EQ filter from 100 to 10000.
% classdef pluginWithLogMapping < audioPlugin
%     properties
%         EQ
%         CenterFrequency = 1000;
%     end
%     properties (Constant)
%         PluginInterface = audioPluginInterface( ...
%             audioPluginParameter('CenterFrequency', ...
%             'Mapping', {'log',100,10000}));
%     end
%     methods
%         function plugin = pluginWithLogMapping
%             plugin.EQ = multibandParametricEQ('NumEQBands',1, ...
%                 'PeakGains',20, ...
%                 'Frequencies',plugin.CenterFrequency);
%         end
%         function out = process(plugin,in)
%             out = plugin.EQ(in);
%         end
%         function set.CenterFrequency(plugin,val)
%             plugin.CenterFrequency = val;
%             plugin.EQ.Frequencies = val;
%         end
%         function reset(plugin)
%             plugin.EQ.SampleRate = getSampleRate(plugin);
%         end
%     end
% end
%
% To run the plugin, save the class definition to a local folder and then call the Audio Test Bench.

audioTestBench(pluginWithLogMapping)

%
% Copyright 2012 The MathWorks, Inc.