0
0
Simulinkdata~10 mins

FFT analysis in Simulink - Interactive Code Practice

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

Complete the code to add an FFT block to the Simulink model.

Simulink
add_block('dspsigops/FFT', '[1]');
Drag options to blanks, or click blank then click option'
AmyModel/FFT
BmyModel/Sine Wave
CmyModel/Scope
DmyModel/Gain
Attempts:
3 left
💡 Hint
Common Mistakes
Using a block path that does not exist in the library.
Using a destination path that conflicts with existing blocks.
2fill in blank
medium

Complete the code to set the FFT block's input port to the signal named 'inputSignal'.

Simulink
add_line('myModel/[1]', 'myModel/FFT/1');
Drag options to blanks, or click blank then click option'
AoutputSignal
BcontrolSignal
CinputSignal
DnoiseSignal
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the input to a signal that does not exist.
Using the output signal name instead of the input.
3fill in blank
hard

Fix the error in the code to correctly run the FFT analysis simulation.

Simulink
simOut = sim('[1]');
Drag options to blanks, or click blank then click option'
AmyModel.txt
BmyModel
CmyModel.mdl
DmyModel.slx
Attempts:
3 left
💡 Hint
Common Mistakes
Including file extensions in the model name string.
Using a file type that Simulink does not recognize.
4fill in blank
hard

Fill both blanks to extract the FFT magnitude and frequency from the simulation output.

Simulink
fftData = simOut.[1];
frequencies = simOut.[2];
Drag options to blanks, or click blank then click option'
AfftMagnitude
BfftFrequency
CfftMag
Dfreq
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or non-existent variable names.
Mixing magnitude and frequency variable names.
5fill in blank
hard

Fill all three blanks to plot the FFT magnitude versus frequency with labels.

Simulink
plot([1], [2]);
xlabel('[3]');
Drag options to blanks, or click blank then click option'
Afrequencies
BfftData
CFrequency (Hz)
DfftMagnitude
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping x and y data in the plot function.
Forgetting to label the x-axis.