Are filter objects supported for GPU in MATLAB 8.1 (R2013a)?

Illustration
khalilabby - 2021-03-02T11:04:44+00:00
Question: Are filter objects supported for GPU in MATLAB 8.1 (R2013a)?

I want to know if I can use filter objects for GPUs in  MATLAB 8.1 (R2013a). I have the Jacket from AccelerEyes but their filter performance is slower than the MATLAB filter performance. I do not want to use the filter method. I want to use filter objects. Currently, I use the following filter command in matlab (CPUs only):     Hd_custom_cheby2 = fdesign.lowpass('N,Fst,Ast', N, high_limit, A_stop, Fs); custom = design(Hd_custom_cheby2, 'cheby2','SystemObject',true); filteredData = step(custom, data); I want to know if I can do the same for GPUs.  

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

The MATLAB built-in FILTER command supports  gpuArray inputs.
 
You can design the filter using the CHEBY2 function and then use the coefficients to filter data with the filter function. Please type the following command at the MATLAB command prompt to get a list of functions supported on a GPU:
 
>>methods('gpuArray')

MATLAB filter System objects do not support gpuArray inputs, however they support C-code generation which can also be used to speed up processing time. You will need MATLAB Coder for this. You can use FDESIGN to design a filter System object with coefficients that meet the filter specifications and then generate C code to process data with this filter. Please take a look at this documentation link for more information on building filters through a GUI:

 

<https://www.matlabsolutions.com/documentation/signal-processing.php>

Using this GUI you can get MATLAB code for a function that filters data and that can be converted to C code using the CODEGEN command. The  documentation for CODEGEN command is here:

 

<https://www.matlabsolutions.com/documentation/matlab-basics.php>

The FILTER function on the GPU does not support IIR filters. Only FIR filters are supported with no input or output state. If you are using an IIR filter, the best way is try to do the filtering in the frequency domain. You can use FFT and IFFT functions that are supported on the GPU to implement this.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!