0
0
SciPydata~10 mins

2D FFT (fft2) in SciPy - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the 2D FFT function from scipy.

SciPy
from scipy.fft import [1]
Drag options to blanks, or click blank then click option'
Afft2
Bfft
Cifft
Drfft
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the 1D FFT function 'fft' instead of 'fft2'.
Using inverse FFT functions like 'ifft' by mistake.
2fill in blank
medium

Complete the code to apply 2D FFT on the array 'data'.

SciPy
result = [1](data)
Drag options to blanks, or click blank then click option'
Afft2
Bfft
Cifft2
Drfft2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1D FFT 'fft' instead of 'fft2'.
Using inverse FFT 'ifft2' by mistake.
3fill in blank
hard

Fix the error in the code to correctly import fft2 from scipy.fft.

SciPy
from scipy.fft import [1]
result = [1](matrix)
Drag options to blanks, or click blank then click option'
Afft
Bifft
Crfft
Dfft2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fft' instead of 'fft2'.
Using inverse or real FFT functions.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each 2D array to its 2D FFT.

SciPy
fft_results = {name: [1](array) for name, array in data_dict.items() if array.ndim == [2]
Drag options to blanks, or click blank then click option'
Afft2
Bfft
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1D FFT function 'fft' instead of 'fft2'.
Checking for 1D arrays instead of 2D.
5fill in blank
hard

Fill all three blanks to create a dictionary of 2D FFT magnitudes for arrays with shape larger than 3x3.

SciPy
fft_magnitudes = {name: abs([1](array)) for name, array in dataset.items() if array.shape[0] > [2] and array.shape[1] > [3]
Drag options to blanks, or click blank then click option'
Afft
B3
Dfft2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1D FFT 'fft' instead of 'fft2'.
Checking wrong shape dimensions or using wrong comparison values.