Skip to content

Commit 285f00d

Browse files
committed
Added the content for Tutorial 2
1 parent 0b5b147 commit 285f00d

3 files changed

Lines changed: 51 additions & 41 deletions

File tree

.DS_Store

10 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function renderWavesImpl(settings, fft, p) { return (playback = false) => {
295295

296296
// specify filter parameters; as before, the cutoff is set to the Nyquist
297297
var filterCoeffs = firCalculator.lowpass(
298-
{ order: 200
298+
{ order: 1500
299299
, Fs: WEBAUDIO_MAX_SAMPLERATE
300300
, Fc: (WEBAUDIO_MAX_SAMPLERATE / settings.downsamplingFactor) / 2
301301
});

tutorials/tutorial2.html

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<body>
2020
<center>
2121
<div class="tab">
22-
<a href="tutorial1.html" class="button_round">&laquo; Prev </a>
22+
<a href="index.html" class="button_round">&laquo; Prev </a>
2323
<a href="../index.html" class="button_round">Home </a>
24-
<a href="tutorial3.html" class="button_round">Next &raquo;</a>
24+
<!-- <a href="tutorial3.html" class="button_round">Next &raquo;</a> -->
2525
</div>
2626
<div class="tabs">
2727
<button class="button_round" onclick="samplingSection(event, 'Question')" id="defaultOpen">Question</button>
@@ -30,47 +30,53 @@
3030
</center>
3131
<div id = "content-wrap" class="title qs">
3232
<H1>
33-
Tutorial 3: Sampling a Waveform
33+
Tutorial 2: Sampling a Waveform in the Time Domain
3434
</H1>
3535
<hr>
3636
</div>
3737

3838
<div id="Question" class="tabcontent active">
3939
<div class = "qs">
4040
<p>
41-
In the left panel, you can see a sine wave with frequency 440 Hz.
42-
Click on the Play Original button at the bottom left to hear how it sounds.
41+
In the top panel, you can see a sine wave with frequency 440 Hz. Like in the previous tutorial,
42+
you can hear the sound by clicking on "play original" at the bottom of the page.
4343
</p>
4444
<p>
45-
In the right panel, a vertical line at 440 Hz represents the sine wave frequency component.
46-
Remember that a sine (or a cosine) wave has only one frequency component,
47-
in other words, it represents a <u>simple harmonic motion</u> such as the motion of an ideal pendulum or a tuning fork.
45+
As seen in the slides for class 1, the input signal would be some kind of continuous signal, whether analogue or acoustic and would be captured either directly or by a microphone. In this case it is a sinusoidal waveform.
46+
Before the continuous signal can be converted into a set of 0's and 1's, it must be sampled. A simple one-dimensional sampling system would be represented with equation: y[n] = x(nT<sub>s</sub>)
47+
</p>
48+
<p>
49+
The middle panel represents said sampling signal (impulse train) that will poll the input x at time [n].
50+
</p>
51+
<p>
52+
The bottom panel shows the resulting samples with amplitudes corresponding to the polled input signal.
4853
</p>
4954
</div>
5055
<div class = "tab_questions qs">
51-
<button class="button_round ques" onclick="questionlist(event, 'q1')" onmouseover="questionlist(event, 'q1')" id="defaulthover">Question 1</button>
56+
<!-- onmouseover="questionlist(event, 'q1')" -->
57+
<button class="button_round ques" onclick="questionlist(event, 'q1')" id="defaulthover">Question 1</button>
5258
<button class="button_round ques" onclick="questionlist(event, 'q2')">Question 2</button>
5359
<button class="button_round ques" onclick="questionlist(event, 'q3')">Question 3</button>
5460
<button class="button_round ques" onclick="questionlist(event, 'q4')">Question 4</button>
61+
<button class="button_round ques" onclick="questionlist(event, 'q5')">Question 5</button>
5562
</div>
5663
<div id = "q1" class = "tab_questions_content qs">
57-
Now use the top right slider.
58-
With the parameters loaded with the application
59-
(Odd harmonics, 1/x amplitude),
60-
add 10 components (harmonics) to the original sine wave.
61-
You can get the same effect by typing 10 in the top right
62-
box and pressing the Update button. Describe what happens
63-
in the left panel.
64+
Let's get to know the panels, bring the zoom to 300% and start to reduce the sample rate to its minimum. What changes in panels 2 and 3?
6465
</div>
6566
<div id = "q2" class = "tab_questions_content qs">
66-
If you add more components (say, 20), what do you see happening in the left panel?
67+
Now type into the input signal frequency 150 Hz, press update and resize the zoom until you see at least one full cycle of the input signal. How many samples do you get in each period?
68+
Now double the input signal frequency. How many samples do you get per period?
6769
</div>
6870
<div id = "q3" class = "tab_questions_content qs">
69-
Now, what do you see when using 20 harmonics and changing the amplitude values to 1/x2?
71+
Keep the sampling rate at 3 kHz (Nyquist Rate) and set the input signal frequency to 1.5 kHz at the Nyquist Frequency. How many samples per period do you see and where are they? What would the resulting sound look like? By moving the phase slider, what happens to the samples?
72+
What would the resulting sound look like?
7073
</div>
7174
<div id = "q4" class = "tab_questions_content qs">
72-
If you go back to 1/x, change Odd to All, and press the Update button, what happens? Remember that now your highest frequency will be half of the one with only Odd harmonics.
73-
To get a similar maximum frequency value you’ll need to add 40 harmonics in this case.
75+
Now, bypass the Nyquist Frequency to 2700 Hz whilst keeping the sampling rate at 3000 Hz, what do you notice? Can you tell what the resulting frequency.
76+
</div>
77+
<div id = "q5" class = "tab_questions_content qs">
78+
Now set the input signal frequency to 750 and the number of harmonics to two.
79+
With the sampling rate at 3000 Hz, do you notice something in how the input signal is being sampled?
7480
</div>
7581
<main>
7682
<script>
@@ -96,37 +102,41 @@ <H1>
96102
</div>
97103
<div id="Answer" class="tabcontent">
98104
<p>
99-
You have just played with approximations of the most
100-
common waves used in analog syntehsizers: square, triangular, and sawtooth waves.
101-
102-
</p>
103-
<center><img src="../images/SH_101.png"></center>
104-
<p>
105+
These were the core concepts on how a signal is sampled.
105106
<ul>
106107
<li>
107-
Click again on the Play Original button at the bottom left to hear how they sound. Add and remove
108-
partials and check the resulting visuals and sounds.
108+
Question 1 demonstrates the sampling of a sine wave.
109+
</li>
110+
<li>
111+
Question 2 prepares the user for the concept of input signals that are multiples of the sampling rate.
112+
</li>
113+
<li>
114+
Question 3 further the idea of Q.2. and presents the concept of the Nyquist Frequency. What happens to the signal as it approaches
115+
it and how the phase of the signal can change the outcome in the creation of DC signals.
116+
</li>
117+
<li>
118+
Question 4 introduces the idea of signal folding when bypassing the Nyquist frequency.
109119
</li>
110-
</ul>
111-
</p>
112-
<p>
113-
You can also play with these variable and see the results in both panels and hear the results.
114-
</p>
115-
<p>
116-
<ul>
117120
<li>
118-
For instance, describe what do you hear when using 20 Even harmonics with flat amplitude?
119-
Compare the sonic result to using 20 Odd harmonics and flat amplitude.
121+
Finally Question 5 introduces the idea that such concepts not only affect the base harmonic of a signal but also its nth harmonics.
122+
Something that must be taken into account as many sounds contain frequencies above the sampling range and this must be filtered out to prevent ghosting.
120123
</li>
121-
</ul>
124+
</ul>
122125
</p>
126+
<!-- Q1 demonstrates how the sinwave is being sampled -->
127+
<!-- Q2 prepares the user for the concept of input signals that are multiples of the sampling rate -->
128+
<!-- Q3 Presents the concept of the Nyquist Frequency, what happens to the signal as it approaches
129+
it and how the phase of the signal can change the outcome. Also the concepts of a DC signal -->
130+
<!-- Q4 Introduces the idea of signal folding when bypassing the nyquist frequency -->
131+
<!-- Q5 Introduces the idea that such concepts not only affects the base harmonic of a signal but also it's nth harmonics.
132+
Something that must be taken into account as many sounds contain frequencies above the sampling range and this must be filtered out to prevent ghosting.-->
123133
</div>
124134
</div>
125-
<footer>
135+
<!-- <footer>
126136
<div>Digital Audio Workbench Tutorial, by Maxwell Gentili-Morin & Marcelo M. Wanderley </div>
127137
<div>based on the Digital Audio Workbench</div>
128138
<div>Copyright <a href="//www-new.idmil.org/">IDMIL</a>/McGill University, 2023 </div>
129-
</footer>
139+
</footer> -->
130140
<script>
131141
function samplingSection(evt, cityName) {
132142
var i, tabcontent, tablinks;

0 commit comments

Comments
 (0)