The magnitude spectrum shows how strong each frequency component is in a signal. It tells us the size or amplitude of each frequency.
Click to reveal answer
beginner
What does the phase spectrum represent in a signal?
The phase spectrum shows the shift or delay of each frequency component in the signal. It tells us how each frequency is shifted in time.
Click to reveal answer
intermediate
How do you calculate the magnitude spectrum from a complex Fourier transform value?
You calculate the magnitude by taking the square root of the sum of squares of the real and imaginary parts: magnitude = sqrt(real² + imag²).
Click to reveal answer
intermediate
How is the phase spectrum calculated from a complex Fourier transform value?
The phase is calculated using the arctangent of the imaginary part divided by the real part: phase = arctan2(imag, real).
Click to reveal answer
beginner
Why are both magnitude and phase spectra important in signal analysis?
Magnitude shows how much of each frequency is present, while phase shows how those frequencies align in time. Together, they fully describe the signal's frequency content.
Click to reveal answer
What does the magnitude spectrum tell us about a signal?
AThe total energy of the signal
BThe time delay of the signal
CThe noise level in the signal
DThe strength of each frequency component
✗ Incorrect
The magnitude spectrum shows how strong or large each frequency component is in the signal.
Which mathematical function is used to find the phase from the real and imaginary parts?
ASquare root
BArctangent
CLogarithm
DExponential
✗ Incorrect
The phase is calculated using the arctangent of the imaginary part divided by the real part.
If the Fourier transform of a signal at a frequency is 3 + 4i, what is the magnitude?
Hint: FFT magnitude is abs(), phase is angle() in radians [OK]
Common Mistakes:
Confusing magnitude with real part
Not rounding phase correctly
Mixing up signs of phase angles
4. The following code attempts to compute magnitude and phase but has an error:
import numpy as np
x = np.array([1, 2, 3, 4])
F = np.fft.fft(x)
magnitude = np.angle(F)
phase = np.abs(F)
print(magnitude)
print(phase)
What is the error?
medium
A. No error; code runs correctly
B. np.fft.fft() is used incorrectly; should be np.fft.ifft()
C. The input array x must be complex numbers
D. Magnitude and phase are swapped; np.angle() should be for phase, np.abs() for magnitude
Solution
Step 1: Check function usage for magnitude and phase
Magnitude is the absolute value, so np.abs() should be used for magnitude, not np.angle(). Phase is angle, so np.angle() is for phase.
Step 2: Identify swapped assignments
The code assigns magnitude = np.angle(F) and phase = np.abs(F), which is reversed.
Final Answer:
Magnitude and phase are swapped; np.angle() should be for phase, np.abs() for magnitude -> Option D
Quick Check:
Magnitude = abs(), Phase = angle() [OK]
Hint: Remember: abs() for magnitude, angle() for phase [OK]
Common Mistakes:
Swapping magnitude and phase functions
Thinking FFT input must be complex
Confusing FFT and IFFT usage
5. You have a noisy signal and want to keep only frequencies with magnitude above 5. Which steps correctly apply this filter using FFT results stored in F?
hard
A. Calculate magnitude = np.abs(F), create mask = magnitude > 5, then set F_filtered = F * mask
B. Calculate phase = np.angle(F), create mask = phase > 5, then set F_filtered = F * mask
C. Calculate magnitude = np.abs(F), create mask = magnitude < 5, then set F_filtered = F * mask
D. Calculate magnitude = np.abs(F), create mask = magnitude > 5, then set F_filtered = np.abs(F) * mask
Solution
Step 1: Compute magnitude and create mask
Calculate magnitude with np.abs(F). Create a boolean mask where magnitude > 5 to keep strong frequencies.
Step 2: Apply mask to original FFT data
Multiply the complex FFT array F by the mask to zero out weak frequencies, preserving phase and magnitude of strong ones.
Final Answer:
Calculate magnitude = np.abs(F), create mask = magnitude > 5, then set F_filtered = F * mask -> Option A
Quick Check:
Filter by magnitude > 5, multiply mask with F [OK]
Hint: Filter frequencies by magnitude mask, multiply mask with FFT [OK]
Common Mistakes:
Filtering by phase instead of magnitude
Using magnitude < 5 to keep frequencies
Multiplying mask with magnitude only, losing phase info
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.