classdef (StrictDefaults)ggConvolv < audioPlugin & matlab.System
concatenatedTdis44 = randn(1,14700*100);
concatenatedTdis48 = randn(1,16000*100);
properties (Constant, Hidden)
PluginInterface = audioPluginInterface(...
'PluginName','GainGuardian'...
properties(Access = private, Nontunable)
properties(Access = private)
methods(Access = protected)
function setupImpl(plugin, u)
totalTdis = length(plugin.concatenatedTdis44) / N;
plugin.tdiMatrix44 = reshape(plugin.concatenatedTdis44, N, totalTdis)';
firstTdi = plugin.tdiMatrix44(1,:);
plugin.pFIR44 = dsp.FrequencyDomainFIRFilter('Numerator', firstTdi, ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
plugin.currentTDIIndex44 = 1;
totalTdis = length(plugin.concatenatedTdis48) / N;
plugin.tdiMatrix48 = reshape( plugin.concatenatedTdis48, N, totalTdis)';
firstTdi = plugin.tdiMatrix48(1,:);
plugin.pFIR48 = dsp.FrequencyDomainFIRFilter('Numerator', firstTdi, ...
'PartitionForReducedLatency', true, 'PartitionLength', plugin.PartitionSize);
plugin.currentTDIIndex48 = 1;
Fs = getSampleRate(plugin);
plugin.switchSamples = floor(11e-3 * Fs);
plugin.sampleCounter = 0;
function y = step44(plugin,u)
currIdx = plugin.currentTDIIndex44;
plugin.sampleCounter = plugin.sampleCounter + size(u,1);
if plugin.sampleCounter >= plugin.switchSamples
plugin.sampleCounter = mod(plugin.sampleCounter, plugin.switchSamples);
currIdx = mod(currIdx, size(M, 1)) + 1;
filt.Numerator = M(currIdx, 1:size(filt.Numerator,2));
plugin.currentTDIIndex44 = currIdx;
function y = step48(plugin,u)
currIdx = plugin.currentTDIIndex48;
plugin.sampleCounter = plugin.sampleCounter + size(u,1);
if plugin.sampleCounter >= plugin.switchSamples
plugin.sampleCounter = mod(plugin.sampleCounter, plugin.switchSamples);
currIdx = mod(currIdx, size(M, 1)) + 1;
filt.Numerator = M(currIdx, 1:size(filt.Numerator,2));
plugin.currentTDIIndex48 = currIdx;
function y = stepImpl(plugin,u)
Fs = getSampleRate(plugin);
function resetImpl(plugin)
Fs = getSampleRate(plugin);
plugin.switchSamples = floor(11e-3 * Fs);
plugin.sampleCounter = 0;
setLatencyInSamples(plugin, plugin.PartitionSize);
function flag = isInputSizeMutableImpl(~,~)
function varargout = isOutputComplexImpl(~)
function varargout = getOutputSizeImpl(obj)
varargout{1} = propagatedInputSize(obj, 1);
function varargout = getOutputDataTypeImpl(obj)
varargout{1} = propagatedInputDataType(obj, 1);
function varargout = isOutputFixedSizeImpl(obj)
varargout{1} = propagatedInputFixedSize(obj,1);