You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: eeg_autocorr_welch.m
    path of file: ./repos/ICLabel
    
    the code of the file until where you have to start completion: function ac = eeg_autocorr_welch(EEG, pct_data)

% clean input cutoff freq
if ~exist('pct_data', 'var') || isempty(pct_data)
    pct_data = 100;
end

% setup constants
ncomp = 
    
function tmpeeglab = myresample(data, p, q)

% Default cutoff frequency (pi rad / smp)
fc = 0.9;

% Default transition band width (pi rad / smp)
df = 0.2;

% anti-alias filter
% -----------------
%        data         = eegfiltfft(data', 256, 0, 128*pnts/new_pnts); % Downsample from 256 to 128 times the ratio of freq.
%                                                                      % Code was verified by Andreas Widdman March  2014

%                                                                      % No! Only cutoff frequency for downsampling was confirmed.
%                                                                      % Upsampling doesn't work and FFT filtering introduces artifacts.
%                                                                      % Also see bug 1757. Replaced May 05, 2015, AW

if p < q, nyq = p / q; else nyq = q / p; end