0% found this document useful (0 votes)
3 views7 pages

MSP - 2025 HW 1 9am

The document outlines a homework assignment consisting of multiple questions related to signal processing, including topics such as the Short-Time Fourier Transform (STFT), discrete Fourier transforms, and time-dependent autocorrelation functions. It also includes practical assignments involving Pure Data for additive synthesis and a Python assignment focused on exploring the STFT trade-off. Students are required to submit their work along with explanations and code as part of their homework submission.

Uploaded by

steinamiti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

MSP - 2025 HW 1 9am

The document outlines a homework assignment consisting of multiple questions related to signal processing, including topics such as the Short-Time Fourier Transform (STFT), discrete Fourier transforms, and time-dependent autocorrelation functions. It also includes practical assignments involving Pure Data for additive synthesis and a Python assignment focused on exploring the STFT trade-off. Students are required to submit their work along with explanations and code as part of their homework submission.

Uploaded by

steinamiti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

MSP Homework 1 – 2025

March 2025

Please include your ID number in your submission.

Question 1
A real-time continuous signal xc (t) is band-limited to frequencies below 5 kHz, meaning

Xc (jΩ) = 0 for |Ω| ≥ 2π · 5000.

This signal is sampled at a rate of 10,000 samples per second to produce a discrete-time
sequence:
x[n] = xc (nT ), with T = 10−4 .

Let X[k] be the 1000-point DFT of x[n].

1. Which continuous-time frequency does the index k = 150 in X[k] correspond to?

2. Which continuous-time frequency does the index k = 800 in X[k] correspond to?

1
Question 2
Show that the Short-Time Fourier Transform (STFT), defined as

X
X[n, λ) = x[n + m]w[m]e−jλm
m=−∞

has the following properties:

1) Linearity: If x[n] = ax1 [n] + bx2 [n], then

X[n, λ) = aX1 [n, λ) + bX2 [n, λ).

2) Shifting: If y[n] = x[n − n0 ], then

Y [n, λ) = X[n − n0 , λ).

3) Modulation: If y[n] = ejω0 n x[n], then

Y [n, λ) = ejω0 n X[n, λ − ω0 ).

4) Conjugate Symmetry: If x[n] is real, then

X[n, λ) = X[n, −λ).

2
Question 3
Given the signal: h  πn i2
x[n] = sin u[n]
2
where the STFT is computed using the window:

1, 0 ≤ n ≤ 13
w[n] =
0, otherwise

Define:  
2πk
X[n, k] = X n, , 0 ≤ k ≤ 6.
7
1. Determine X[0, k] for 0 ≤ k ≤ 6.

2. Evaluate 6k=0 X[n, k] for 0 ≤ n < ∞.


P

Question 4
Previously, we defined the time-dependent Fourier transform of the signal x[m] such that,
for fixed n, it is the DTFT of the sequence x[n + m]w[m], where w[m] is a window function.
Now, define the time-dependent autocorrelation function as:
Z π
1
c[n, m] = |X[n, λ)|2 ejλm dλ
2π −π

This function satisfies the following:

a) Show that if x[n] is real, then



X
c[n, m] = x[n + r]w[r] · x[n + m + r]w[m + r]
r=−∞

i.e., for fixed n, c[n, m] is the aperiodic autocorrelation of the sequence x[n + r]w[r].

b) Show that c[n, m] is an even function of m for fixed n, and derive the equivalent
expression:
X∞
c[n, m] = x[r]x[r − m]hm [n − r]
r=−∞

where
hm [r] = w[−r]w[−(m + r)].

3
Question 5 (From past exam)
We sample the note A2 (a pitch frequency of 110 Hz with 3 overtones) at a rate of 550
samples per second, and then perform a length-N DFT (with a square window).
(A.) If N = 5, which frequency bins have values that are non-zero? (comment: bin #1
is second after bin #0.)
(B.) If N = 15, which frequency bins have values that are non-zero?
(C.) If N = 16, which frequency bins have values that are non-zero?
(D.) If N = 32 = 16 signal samples + 16 zero-padding samples, is the result identical to
the N=16 case?
(E.) If N = 30 = 15 signal samples + 15 zero-padding samples, is the result identical to
the N=30 case?

4
Pure Data Assignment: Melodic Sequencer
Two synthesis methods were discussed in the recitation: additive and subtractive. The
subtractive synthesizer was shown in use with a sequencer. In this assignment, you’ll design
a melodic sequencer using additive synthesis.

Goal: Use a sequencer to trigger additive synthesis to create a melody.


There are multiple valid implementations. For instance:

• The sequencer could send bangs to multiple synths, each tuned to a specific pitch.

• The sequencer could control the pitch of a single synth dynamically.

Instructions:

• Create your patch in Pure Data.

• Submit your .pd files along with your homework.

• The choice of melody is entirely up to you.

If you’d like a suggested sequence to start with, try the following A-minor arpeggio
(frequencies in Hz):

A (440), C (523), E (659), C (523), A (440), C (523), E (659), C (523)

Experimenting with pitch and the pattern is highly encouraged.

5
The First Python Assignment: STFT Trade-Off Explo-
ration
In this assignment, we will explore the frequency-time resolution trade-off inherent in
the Short-Time Fourier Transform (STFT).
Each student will receive a unique signal provided as a CSV file. This signal is composed
of five elementary parts:

• Two impulses

• Two sinusoidal components

• One “interference” sinusoid

Objective: Identify the frequencies of the sinusoidal components and the time-locations
of the impulses using the STFT.
The signals are sampled at 1000 Hz.

Instructions:

• Implement the STFT using the SciPy Signal Processing Library.

• The function scipy.signal.stft returns:

– An array of frequencies
– An array of time values
– A matrix representing the spectrogram

• You may also use scipy.signal.find peaks to help identify frequency or time fea-
tures. Be mindful of how you choose threshold values when filtering peaks.

Discussion:

• What trade-offs arise when selecting different window sizes?

• How does window size affect your ability to resolve:

– Time-localized phenomena (e.g., impulses)


– Frequency-localized phenomena (e.g., sinusoids)

• Which window type and size produced the most useful results for your signal?

6
Deliverables:

• A brief explanation of the window choices you experimented with

• Your best estimates for:

– The two sinusoidal frequencies


– The time indices of the impulses

• Your Python code (included as an attachment or appendix)

You might also like