function y = downsample(x,varargin)
%DOWNSAMPLE Downsample gpuArray input signal.
%   DOWNSAMPLE(X,N)
%   DOWNSAMPLE(X,N,PHASE)
%
%   See also DOWNSAMPLE, UPSAMPLE, gpuArray.

% Copyright 2020 The MathWorks, Inc.

% Ensure only data is on the GPU
if nargin>1
    [varargin{:}] = gather(varargin{:});
end
% Call the standard function
y = parallel.internal.array.callToolboxFunction('signal/signal/downsample.m', ...
    x, varargin{:});