0
0
SciPydata~10 mins

Inverse FFT (ifft) 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 inverse FFT function from scipy.

SciPy
from scipy.fft import [1]
Drag options to blanks, or click blank then click option'
Aifft
Brfft
Cfft
Dfftn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fft' instead of 'ifft' will perform forward transform, not inverse.
Using 'rfft' is for real FFT, not inverse.
2fill in blank
medium

Complete the code to compute the inverse FFT of the array 'freq_data'.

SciPy
time_data = [1](freq_data)
Drag options to blanks, or click blank then click option'
Arfft
Bfft
Cifft
Dfftn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fft' will not invert the transform.
Using 'rfft' or 'fftn' are incorrect for this purpose.
3fill in blank
hard

Fix the error in the code to correctly compute the inverse FFT of 'freq_array'.

SciPy
result = scipy.fft.[1](freq_array)
Drag options to blanks, or click blank then click option'
Arfft
Bifft
Cfft
Dfftn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fft' instead of 'ifft' causes wrong output.
Using 'rfft' or 'fftn' are not the inverse FFT.
4fill in blank
hard

Fill both blanks to correctly prepare the frequency data with inverse shift before inverse FFT in the dictionary comprehension.

SciPy
inv_fft_dict = {k: ifft([1]([2])) for k, v in freq_dict.items()}
Drag options to blanks, or click blank then click option'
Aifftshift
Bv
Cfftshift
Dfreq_dict
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fftshift' instead of 'ifftshift' applies the forward shift.
Using 'v' in wrong place or forgetting shift leads to misordered time data.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps each frequency to the inverse FFT of its complex conjugate if the magnitude is greater than 1 and val is complex.

SciPy
inv_fft_map = {freq: ifft([1]) for freq, val in freq_vals.items() if abs(val) [2] 1 and [3]
Drag options to blanks, or click blank then click option'
Aval.conjugate()
B>
Cisinstance(val, complex)
Dval.real
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'val.real' instead of conjugate loses imaginary part.
Using '<' instead of '>' in magnitude check selects small values.
Incorrect type check like 'val == complex' fails.