You are on page 1of 2

ENSE807

Digital Signal Processing


(Assignment 1)

Drum Machine
This is an individual assessment. Do not share your work or post it online. If you use
material found in the literature or online, it must be referenced correctly (e.g. using the
APA referencing style). In terms of your academic work, quoted and paraphrased
material does not count as your contribution, so you will not get marks for it. But you
will be marked for synthesising new knowledge from quoted and paraphrased material.

Generally, this assignment is not about looking up existing solutions on the internet. It is
about creating your solution. This assignment aims to demonstrate your skills and
understanding of the lecture and labs. You may use the Matlab code from the example
solutions of the lab exercises.

The task of this assignment is to develop a drum machine. The first part is to create a
mathematical model. The second part is to implement the drum machine in Matlab.

Part 1: Mathematical model


The drum machine is specified as follows:
The drum machine is a computer program that plays drum sounds according to a table
given by the user.
• The drum sounds are: Open hihat, Closed hihat, Snare drum, Bass drum, Tom
Toms, and Cymbals
• The drum sounds are played at specific points in time, called ‘beat’. Example: A
common speed for pop music is 130 bpm, i.e. 130 beats per minute. Then, the
period between two beats is about 0.46 seconds. A song of 3:30min has about 457
beats, numbered from 1, 2, 3, …, 457.
• The rows of the table represent the drum sounds (1 = Open hihat, 2= Closed hihat,
3 = Snare drum, 4= Bass drum, 5= Tom Toms, 6= Cymbals).
• The columns of the table represent the beats.
• The table contains the values zero and one. A value of ‘1’ means a drum sound is
played, whereas ‘0’ indicates that the sound is not played. Example: A value of
‘1’ at row 4 and column 5 means that the sound of the Bass drum is played at beat
5, i.e. the sound would start 1.84 seconds into the song.
• The output of the drum machine is stored in a wave file.
• Your task: Describe the drum machine mathematically.
• Help: It may help you start making a drawing, e.g., drawing an example of the
table similar to Table 1 below, and a block diagram of the system. You may need
to make some definitions and assumptions, e.g. “let {g[n]} denote a basic snare
sound”, or you can define basic sounds by sampling sine curves (more
complicated). You can combine basic discrete-time systems from the lecture, e.g.
modulation, adder, and delay. At some point, you will need to make up your mind

1
about the time axis: You will need to convert from ‘beats’ to ‘seconds’ and
‘samples’.
• If you find this too difficult, you may simplify the specification. It is better to
simplify things than to submit somebody else’s solution.

Table 1: Example of the drum sounds


beat beat beat beat beat beat beat beat beat ….. …
1 2 3 4 5 6 7 8 9
1 Open 0 1 1 1 0 0 0 1 1 … …
hihat
2 Closed 0 0 0 1 0 1 1 0 1 … …
hihat
3 Snare 0 1 0 1 1 0 0 1 1 … …
Drum
4 Bass 1 1 1 1 1 0 0 0 1 … …
Drum
5 Tom- 0 0 0 1 0 1 1 0 1 … …
Toms
6 Cymbals 0 0 0 1 0 1 1 0 1 … …
sound

Part 2: Matlab implementation


Implement the drum machine in a Matlab program (i.e. scripts and functions).
You may base your solution on the example solution from the lab exercises if you think it
will help. There is already a script that plays drum sounds.

Marking scheme:
Marks will be given as follows:
+2 Correctness/consistency of the mathematical model
+4 The model does not simplify the specification
+2 High degree of formalisation of the mathematical model (i.e. there are equations)
+2 Clarity of the presentation of the mathematical model (i.e. equations are explained)
+8 The Matlab code runs without errors
+8The Matlab code is recognisably related to a drum machine
+8 The program does not simplify the specification
+6 Overall, the solution demonstrates outstanding mastery of the material
The total of 40 marks corresponds to 40% of the final grade.

Due date:
Compress all your files to a zip archive. Submissions can be made through
Canvas until Friday, 07.4.2023, at 4:00 pm.
Do not wait until the last minute.

Marking Schedule:
This project will be marked and counted for 40% of your final mark for this course.

You might also like