Bird
Raised Fist0
Signal Processingdata~10 mins

Signal properties (amplitude, frequency, phase) in Signal Processing - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Signal properties (amplitude, frequency, phase)
Start: Define signal parameters
↓
Calculate amplitude
↓
Calculate frequency
↓
Calculate phase
↓
Generate signal values
↓
Output signal waveform
The flow shows defining signal parameters, calculating amplitude, frequency, and phase, then generating the signal waveform.
Execution Sample
Signal Processing
import numpy as np
import matplotlib.pyplot as plt

A = 2
f = 5
phi = np.pi/4

t = np.linspace(0, 1, 500)
signal = A * np.sin(2 * np.pi * f * t + phi)
This code creates a sine wave signal with amplitude 2, frequency 5 Hz, and phase π/4 radians over 1 second.
Execution Table
StepVariable/ExpressionCalculationValue
1A (Amplitude)Defined as 22
2f (Frequency)Defined as 5 Hz5
3phi (Phase)Defined as π/4 radians0.7854
4t (Time array)np.linspace(0,1,500)Array from 0 to 1 with 500 points
5signal[0]2 * sin(2π * 5 * 0 + 0.7854)1.4142
6signal[100]2 * sin(2π * 5 * 0.2004 + 0.7854)1.9997
7signal[250]2 * sin(2π * 5 * 0.500 + 0.7854)-1.4142
8signal[499]2 * sin(2π * 5 * 1.000 + 0.7854)1.4142
9OutputPlot signal vs timeSine wave with amplitude 2, freq 5 Hz, phase π/4
💡 All signal points calculated; waveform generated for 1 second duration.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
Aundefined22222
fundefinedundefined5555
phiundefinedundefinedundefined0.78540.78540.7854
tundefinedundefinedundefinedundefinedarray(0 to 1, 500 pts)array(0 to 1, 500 pts)
signalundefinedundefinedundefinedundefinedundefinedarray of 500 sine values
Key Moments - 3 Insights
Why does the phase shift the signal horizontally instead of changing its height?
Phase (phi) adds inside the sine function's angle, shifting the wave left or right in time, not changing amplitude (height). See execution_table rows 5-8 where values shift but amplitude stays max 2.
How does frequency affect the number of wave cycles in the signal?
Frequency (f) controls how many cycles occur per second. Higher f means more cycles in the same time. In execution_table, signal values at different t show wave oscillations repeating 5 times in 1 second.
Why is amplitude constant across the signal values?
Amplitude (A) scales the sine wave's peak height. It multiplies the sine value directly, so max and min values are ±A. Execution_table rows show max around 2 and min around -2.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table row 5, what is the signal value at time t=0?
A1.4142
B0
C2
D-1.4142
💡 Hint
Check row 5 in execution_table where signal[0] is calculated.
At which step does the time array 't' get created?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Look at execution_table row 4 describing 't' creation.
If amplitude A was changed to 3, how would signal[100] value change compared to current 1.9997?
AIt would be about 1.4142
BIt would be about 3.0
CIt would stay 1.9997
DIt would be zero
💡 Hint
Amplitude scales the sine wave linearly; see variable_tracker for A and signal relation.
Concept Snapshot
Signal properties:
- Amplitude (A): height of wave peaks
- Frequency (f): cycles per second
- Phase (phi): horizontal shift in radians
Signal formula: signal = A * sin(2πft + phi)
Changing A scales height, f changes cycles, phi shifts wave left/right.
Full Transcript
This visual execution traces how signal properties amplitude, frequency, and phase define a sine wave signal. We start by setting amplitude A=2, frequency f=5 Hz, and phase phi=π/4 radians. Then we create a time array t from 0 to 1 second with 500 points. The signal is calculated as A times sine of (2πft + phi). The execution table shows step-by-step calculations of signal values at different times, illustrating how amplitude scales the wave height, frequency controls the number of cycles, and phase shifts the wave horizontally. Variable tracker shows how each parameter is set and used. Key moments clarify common confusions about phase shifting, frequency effect, and amplitude scaling. The quiz tests understanding of signal value at t=0, when time array is created, and effect of changing amplitude. The snapshot summarizes the core formula and effects of each property on the signal waveform.

Practice

(1/5)
1. Which property of a signal describes how tall or strong the wave is?
easy
A. Frequency
B. Amplitude
C. Phase
D. Wavelength

Solution

  1. Step 1: Understand amplitude meaning

    Amplitude measures the height or strength of a wave, showing how strong the signal is.
  2. Step 2: Compare with other properties

    Frequency is how often the wave repeats, phase shifts the start, wavelength is distance, not height.
  3. Final Answer:

    Amplitude -> Option B
  4. Quick Check:

    Amplitude = wave height [OK]
Hint: Amplitude means wave height or strength [OK]
Common Mistakes:
  • Confusing amplitude with frequency
  • Thinking phase affects height
  • Mixing wavelength with amplitude
2. Which of the following is the correct way to represent a sine wave with amplitude 3 and frequency 5 Hz in Python using numpy?
t = np.linspace(0, 1, 500)
y = ?
easy
A. 3 + np.sin(2 * np.pi * 5 * t)
B. np.sin(3 * 2 * np.pi * 5 * t)
C. 3 * np.sin(2 * np.pi * 5 * t)
D. 5 * np.sin(2 * np.pi * 3 * t)

Solution

  1. Step 1: Recall sine wave formula

    The sine wave formula is amplitude * sin(2π * frequency * time).
  2. Step 2: Match formula to options

    3 * np.sin(2 * np.pi * 5 * t) matches amplitude 3 and frequency 5 correctly as 3 * sin(2π * 5 * t).
  3. Final Answer:

    3 * np.sin(2 * np.pi * 5 * t) -> Option C
  4. Quick Check:

    Amplitude * sin(2π * frequency * t) [OK]
Hint: Amplitude multiplies sine, frequency inside sine argument [OK]
Common Mistakes:
  • Multiplying frequency by amplitude inside sine
  • Adding amplitude instead of multiplying
  • Swapping amplitude and frequency
3. Given the code:
import numpy as np
t = np.linspace(0, 1, 5)
y = 2 * np.sin(2 * np.pi * 1 * t + np.pi/2)
print(np.round(y, 2))

What is the output?
medium
A. [ 2. 0. -2. 0. 2. ]
B. [ 2. 1.41 0. -1.41 -2. ]
C. [ 0. 1.41 2. 1.41 0. ]
D. [ 1.41 2. 1.41 0. -1.41]

Solution

  1. Step 1: Calculate time points

    t = [0, 0.25, 0.5, 0.75, 1]
  2. Step 2: Compute y values

    y = 2 * sin(2π * 1 * t + π/2) = 2 * cos(2π * t) due to phase shift π/2.
    Values: 2*cos(0)=2, 2*cos(π/2)=0, 2*cos(π)=-2, 2*cos(3π/2)=0, 2*cos(2π)=2
    np.round(y, 2) prints [ 2. 0. -2. 0. 2. ]
  3. Final Answer:

    [ 2. 0. -2. 0. 2. ] -> Option A
  4. Quick Check:

    Phase π/2 shifts sine to cosine [OK]
Hint: Phase π/2 shifts sine to cosine wave [OK]
Common Mistakes:
  • Ignoring phase shift
  • Rounding errors
  • Mixing sine and cosine values
4. Identify the error in this code snippet that tries to create a sine wave with amplitude 4 and frequency 2 Hz:
import numpy as np
t = np.linspace(0, 1, 100)
y = 4 * np.sin(2 * np.pi * t) * 2
medium
A. The time vector t should be integers, not floats
B. Amplitude should be added, not multiplied
C. np.linspace should use 0 to 2 instead of 0 to 1
D. The frequency multiplier is in the wrong place; it should be inside the sine argument as 2 * np.pi * 2 * t

Solution

  1. Step 1: Analyze sine argument order

    The sine argument is 2π * t (frequency 1 Hz), but *2 is outside sin(), incorrectly scaling the amplitude instead of frequency.
  2. Step 2: Correct placement for frequency

    Frequency multiplier must be inside sine: 2 * np.pi * 2 * t.
  3. Final Answer:

    The frequency multiplier is in the wrong place; it should be inside the sine argument as 2 * np.pi * 2 * t -> Option D
  4. Quick Check:

    Frequency must multiply time inside sine [OK]
Hint: Write frequency right after 2π inside sine [OK]
Common Mistakes:
  • Multiplying amplitude incorrectly
  • Using wrong time vector type
  • Changing linspace range unnecessarily
5. You have a signal defined as y = 5 * np.sin(2 * np.pi * 3 * t + π/4). If you want to double the frequency and halve the amplitude while keeping the phase shift the same, which expression is correct?
hard
A. y = 2.5 * np.sin(2 * np.pi * 6 * t + π/4)
B. y = 10 * np.sin(2 * np.pi * 1.5 * t + π/4)
C. y = 2.5 * np.sin(2 * np.pi * 3 * t + π/2)
D. y = 5 * np.sin(2 * np.pi * 6 * t)

Solution

  1. Step 1: Adjust amplitude and frequency

    Original amplitude is 5, halved is 2.5. Original frequency is 3, doubled is 6.
  2. Step 2: Keep phase shift same

    Phase shift π/4 remains unchanged in the new expression.
  3. Final Answer:

    y = 2.5 * np.sin(2 * np.pi * 6 * t + π/4) -> Option A
  4. Quick Check:

    Amplitude halved, frequency doubled, phase same [OK]
Hint: Multiply frequency by 2, amplitude by 0.5, keep phase [OK]
Common Mistakes:
  • Changing phase shift incorrectly
  • Multiplying amplitude instead of halving
  • Swapping frequency and amplitude values
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard