Skip to content
Advertisement

MATLAB freqz2 equivalent in Python

I’m trying to find a Python library that works equivalently to MATLAB’s freqz2 for image processing, since scipy.signal.freqz only seems to work for 1-D arrays.

Advertisement

Answer

Found an amazing library for plotting the 3D surface of the 2-D FFT called plotly. I leave here the lines of code I used to emulate the same behaviour of freqz2 in Python:

JavaScript

The 3D graphs is interactive, and the fspecial function in python I implemented it myself copying what MATLAB does (I can also post it if asked). enter image description here

Which is the equivalent to MATLAB’s:

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement