CS计算机代考程序代写 matlab flex PowerPoint Presentation

PowerPoint Presentation

Prof. Eliathamby Ambikairajah, School of EE&T Term 3, 2021
1

ELEC3104: Mini-Project – Cochlear Signal Processing

Modified SOLO taxonomy framework

2

✓ The Structure of Observed Learning Outcomes (SOLO) taxonomy is a framework for analysing students’ depth of
knowledge.

✓ It describes 6 Hierarchical levels (Levels 0 to 5) of increasing complexity in student’s understanding of topics studied.

✓ The taxonomy encourages students to think about which level they are currently with their learning and what they need
to do in order to progress to the next level.

✓ SOLO taxonomy has been adapted for this course to include Pass, Credit, Distinction and High Distinction levels to help
the students to understand the different levels (Levels 0 to 5) on the learning curve and what they need to do to progress.

✓ Students may choose to stay on in a particular level without moving to the next level.

✓ The mini-project is designed to provide an increasing complexity from Pass (Level 2) to High distinction (Level 5) levels
as shown below.

Different Stages of the Modified SOLO
Taxonomy

ELEC3104: Project Outline

3

✓ This mini project (individual) will focus on understanding and modelling the spectral analyses carried out by
the human cochlea.d modelling the spectral analyses carried out by the human cochlea.

SOLO – Level 1

▪ Introduction to Human Auditory System and MATLAB coding fundamentals

SOLO – Level 2 (Pass Level)

▪ Implementation of a parallel FIR filter bank model of the cochlea for analysis and synthesis purposes.

SOLO – Level 3 (Credit Level)

▪ Implementation of a parallel FIR filter bank model of the cochlea for spectral analysis.

SOLO – Level 4 (Distinction Level)

▪ Implementation of a parallel FIR filter bank model of the cochlea for pitch detection.

SOLO – Level 5 (High Distinction Level)

▪ Incorporate mechanisms into the parallel IIR filter bank cochlea model that makes the filterbank
adaptive.

Additional Information: In addition to the information provided to you in these slides, you are strongly encouraged
to find and view animations and videos that describe the functioning of the peripheral auditory system and the
cochlea in particular. Visualisation in the form of these animations will be very helpful in understanding cochlear
signal processing.

Eg: Cochlear Animation – https://www.youtube.com/watch?v=dyenMluFaUw

Prof. Eliathamby Ambikairajah, School of EE&T Term 3, 2021
4

ELEC3104: Mini-Project – Cochlear Signal Processing

SOLO – Level 1: Introduction to Human Auditory System
and MATLAB coding fundamentals

Introduction to the Human Auditory System

5

✓ The human auditory system is responsible for
converting pressure variations caused by the
sound waves that reach the ear into nerve
impulses that are interpreted by the brain.

✓ The Human Auditory System is designed to
assess frequency (pitch) and amplitude
(loudness).

✓ The peripheral auditory system is divided into
the Outer Ear, Middle Ear, and Inner Ear.

✓ The peripheral auditory system and in particular
the cochlea can be viewed as a real-time
spectrum analyser.

✓ The primary role of the cochlea is to transform
the incoming complex sound wave at the ear
drum into electrical signals.

✓ The human ear can respond to minute pressure
variations in the air if they are in the
audible frequency range, roughly 20 Hz – 20 kHz

L

Electrical
signals.

Sounds Level

Faint 20dB (A faint Whisper is 30dB)

Soft (Quiet) 40dB

Moderate 60dB (normal conversation)

Loud 80dB (alarm clocks, vacuum cleaners)

Very Loud 90dB(Blenders);110dB (Concerts, car horns)

Uncomfortable 120dB (jet planes during take off)

Painful and
dangerous

130dB(Jackhammers); 140dB(Gunshots)
*Use hearing protection

✓ Over 85 dB for extended periods can cause permanent hearing loss

✓ Zero decibels (0 dB) represent the absolute threshold of human
hearing, below which we cannot hear a sound.

Outer Ear (Air Vibration): A resonator

6

✓ The pinna surround the ear canal and functions
as sound wave reflectors and attenuators .

✓ The sound waves enter a tube-like structure
called ear canal and it serves as a sound
amplifier.

✓ The sound waves travel through the canal and
reach the eardrum and cause it to vibrate

✓ The length (L) of the human ear canal is 2.8 cm
(and 7 mm in diameter)

✓ Speed of sound (c) = 340.3 m/sec ;

✓ The resonant frequency (f) of the canal is =
𝑐

4𝐿

= 3,038Hz.

✓ The human outer ear is most sensitive at about
3kHz and provides about 20dB (decibels) of
gain to the eardrum at around 3000Hz.

Outer ear is a low-Q bandpass filter
(Representative figure only)

Middle Ear: An Impedance Matcher & an Amplifier

7

✓ Middle ear transforms the vibrating motion of
the eardrum into motion of the stapes via the
two tiny bones, the malleus and incus .

✓ The pressure of the sound waves on the oval
window is around 25 times higher than on the
eardrum.

✓ Since the sound Intensity (𝐼) is proportional (∝)
to the square pressure (𝑃2) , the sound intensity
increases 625 times (or 28dB)

✓ Middle ear converts acoustic energy to
mechanical energy and mechanical energy to
hydraulic energy

Outer Ear Middle Ear

To

cochlea
Sound

input
dB

f
dB

f

The combined frequency response of the outer
and middle ear is a band-pass response, with
its peak dominated near 3 kHz

Middle Ear Gain function

d
B

Inner Ear

8

✓ The inner ear consists of the cochlea responsible for converting the
vibrations of sound waves into electrochemical impulses which are
passed on to the brain via the auditory nerve.

✓ The cochlea is a spiral shaped structure which is about 3.5 cm in length
if uncoiled.

✓ The cochlea is divided along its length by the basilar membrane (BM)
which partitions the cochlear into two fluid canals (scala vestibuli and
scala tympani).

✓ The BM terminates just reaching the helicotrema, so there is a passage
way between the scala vistibuli and the scala tymapni equalising the
difference in pressure at the ends of the two scalas.

A longitudinal

section of an

uncoiled cochlea

Basilar Membrane (Hydro Dynamical process)

9

✓ The Basilar Membrane varies in width and stiffness along
its length.

✓ At basal end it is narrow and stiff where as towards the
apex it is wider and more flexible.

✓ Each point along the basilar membrane has a
characteristic frequency, 𝑓𝑝(𝑥), to which it is most

responsive.

✓ The maximum membrane displacement occurring at the
basal end for high frequencies (20 kHz) and at the apical
end for low frequencies (70Hz) .

✓ When the vibrations of the eardrum are transmitted by
the middle ear into movement of the stapes, the
resulting pressure differences between the cochlear fluid
chambers, generate a travelling wave that propagates
down the cochlea and reach maximum amplitude of
displacement on the basilar membrane at a particular
point before slowing down and decaying rapidly

✓ The location of the maximum amplitude of this travelling
wave varies with the frequency of the eardrum
vibrations

3.5 cm

Base
Apex

= 3.5 cm

Basilar membrane
0.05155 cm

If 𝑥 is the distance of a point on the basilar membrane from
the stapes, then the frequency, 𝑓𝑝(𝑥), that produces a peak

at this point is given by:

𝑓𝑝 𝑥 = 20000.0 10
−0.667 𝑥 𝐻𝑧 0 ≤ 𝑥 ≤ 3.5 𝑐𝑚

• It is evident that a 20 kHz tone at the stapes will cause the
BM to vibrate at a point 𝑥 = 0.

• A 70 Hz tone will excite the BM at a point x = 3.5 cm (i.e.
at the apex)

The basilar membrane is a resonant structure that vibrates, vertically in
sympathy with pressure variations in the cochlear fluid.

Basilar Membrane

10

✓ Different frequencies stimulate different areas of the
basilar membrane

✓ When a tone (single sinusoid) is applied, the
cochlear fluid oscillates in phase with the stimulating
frequency causing a travelling wave pattern of the
vibration on the basilar membrane

✓ There will be one place where the resonant
frequency of the membrane matches the stimulus
frequency and this place will show the maximum
amount of vibration

✓ By measuring vibration at particular points on the
membrane for a range of stimulus frequencies we
can plot the frequency response of each place on
the membrane

✓ The essential function of the basilar membrane is to
act as a frequency analyser (a set of band-pass filters
each responding to a different frequency region)
resolving an input sound at the eardrum into its
constituent frequencies

Organ of Corti

11

✓ Attached to the basilar membrane and running its entire
length is the organ of corti containing some 30,000 sensory
hair cells.

✓ The hairs (cilia) of these cells stick up from the organ of corti
and are in contact with overlying Tectorial Membrane

✓ There are two types of sensory hair cells:

▪ One row of inner hair cells, whose cilia float freely in the
fluid-filled region called subtectorial space

▪ Three rows of outer hair cells whose cilia are attached to
the tectorial membrane

✓ Most of the afferent fibres (neurons which carry signals to
the brain) come from inner hair cells,

✓ The efferent fibres (which receive signals from the brain) go
mainly to outer hair cells.

✓ When the basilar membrane deflects, due to pressure wave
in the cochlear fluid, the tectorial membrane move and
shear which causes the hairs of the outer hair cells to bend
and also cause the fluid flow in the subtectorial space.

✓ This in turn triggers the inner hair cells to transmit nerve
impulses along the afferent fibres and eventually to brain.

✓ The motion of each part of the basilar membrane as
detected by the inner hair cells is transmitted as neural
description to the brain. A simplified Diagram of a Human Auditory System

OUTER &

MIDDLE

EARs

SOUND BASILAR

MEMBRANE

INNER HAIR

CELLS

OUTER

HAIR CELLS

AFFERENT

FIBRES

EFFERENT

FIBRES

AUDITORY

PROCESSING

(Brain)

Inner Ear (Cochlea)
Nerve Fibres

Organ of Corti

Mechanical to Neural Transduction (Electro Chemical)

12

✓ The mechanical displacement to electrical energy
transduction process takes place in the inner hair
cells

✓ Bending of the inner hair cell cilia due to basilar
membrane displacement produces a change in the
overall resistance (reduces it) of the inner hair cell,
thus modulating current flow through the hair cell.

✓ The modulation being directly proportional to the
degree of bending of the cilia and the bending of
the cilia is one direction only; in effect a half wave
rectification of the basilar membrane displacement
takes place.

✓ Bending of the cilia releases neurotransmitter
which passes into synapses of one or more nerve
cells which fire to indicate vibration

✓ The amount of firing is thus related to the amount
of vibration

✓ Since the neurotransmitter is only released when
the cilia are bent in one direction, firing tends to be
in phase with basilar membrane movement

Here bending the inner hair cell cilia is simulated by
charging of the capacitor and returning to the initial
position of the cilia is equivalent to discharging the
capacitor.

Inner Hair Cell model

Cochlear Modelling: Cascade and Parallel Models

13

✓ The basic model of the cochlea is a transmission line model
(cascade model) in which the basilar membrane is modelled as a
cascade of 128 low pass filters, notch filters and resonators as
shown above.

✓ Each digital filter section in the model above represents a section
of the basilar membrane (tuned to a specific frequency) with 128
sections representing the entire basilar membrane

Magnitude response
of the cascaded filter
bank model

✓ The peripheral auditory system is often
modelled as a bank of 128 bandpass filters
(auditory filters) with overlapping passbands.

✓ Typically modelled using a finite number of
bandpass filters, equally spaced along the
Basilar Membrane.

Magnitude response of the parallel filter bank model

Prof. Eliathamby Ambikairajah, School of EE&T Term 3, 2021
14

ELEC3104: Mini-Project – Cochlear Signal Processing

SOLO – Level 1: Learning Activities (MATLAB Coding)

Learning Activity 1: Modelling the Outer Ear and the Middle Ear

15

✓ The middle ear may be modelled as a cascade of two complex pairs of zeros (to remove very high and very low
frequencies) and one complex pair of poles (to provide low-Q gain at the middle frequencies). The approximate frequency
response of the middle ear can be seen in the figure below.
Assuming a sampling frequency of 16kHz:

(a) Obtain the transfer function of the middle ear filter, by suitably placing poles and zeros on the z-plane. Verify your
results in MATLAB.

(b) Using placement of poles and zeros, estimate a model for the outer ear and cascade it with your previous model of
the middle ear and show using MATLAB that the overall response matches the one shown in this figure.

The combined frequency response of the outer
and middle ear is a band-pass response (sum –
see the adjacent magnitude response diagram),
with its peak dominated near 3 kHz

Filter Design: Pole zero placement

16

✓ Calculate the digital filter coefficients of the resonant pole and resonant zeros using pole zero
placement (e.g. : see diagram below)

✓ Resonant pole frequency = 𝜃𝑝; radius = 𝑟𝑝; 𝜃𝑝 =
2𝜋𝑓𝑝

𝑓𝑠
; 𝑓𝑠 = 16𝑘𝐻𝑧 (or higher)

✓ Resonant zero frequency = 𝜃𝑧; radius = 𝑟𝑧 (𝑟𝑧 > 𝑟𝑝 and closer to unit circle); 𝜃𝑧 =
2𝜋𝑓𝑧

𝑓𝑠

✓ 𝐻𝑝 𝑧 =
𝑧2

𝑧−𝑟𝑝𝑒
𝑗𝜃𝑝 𝑧−𝑟𝑝𝑒

−𝑗𝜃𝑝
=

𝑧2

𝑧2−𝑟𝑝 𝑒
𝑗𝜃𝑝+𝑒

−𝑗𝜃𝑝 𝑧+𝑟𝑝
2
=

𝑧2

𝑧2−𝑟𝑝 2 cos 𝜃𝑝 𝑧+𝑟𝑝
2 =

1

1−2𝑟𝑝 cos 𝜃𝑝𝑧
−1+𝑟𝑝

2𝑧−2

✓ 𝐻𝑝 𝑧 =
1

1−𝑏1𝑧
−1+𝑏2𝑧

−2
(from one section of the digital filter) – Equating to above, we obtain

𝑏1 = 2𝑟𝑝 cos 𝜃𝑝 and 𝑏2 = 𝑟𝑝
2.

✓ Similarly, 𝑎1 = 2𝑟𝑧 cos 𝜃𝑧 and 𝑎2 = 𝑟𝑧
2 for 𝐻𝑧 𝑧 = 1 − 𝑎1𝑧

−1 + 𝑎2𝑧
−2

✓ Both transfer functions can be normalised such that DC gain = 1 as follows:

𝐻𝑝 𝑧 =
1−𝑏1+𝑏2

1−𝑏1𝑧
−1+𝑏2𝑧

−2
and 𝐻𝑧 𝑧 =

1−𝑎1𝑧
−1+𝑎2𝑧

−2

1−𝑎1+𝑎2

✓ 𝑟𝑝 and 𝑟𝑧 can be calculated approximately as follows:

𝑟𝑝 ≈ 1 −
𝐵𝑊𝑝

𝑓𝑠
𝜋 ; 𝑟𝑧 ≈ 1 −

𝐵𝑊𝑧

𝑓𝑠
𝜋

𝑄𝑝 =
𝑓𝑝

𝐵𝑊𝑝
;Q-factors: 𝑄𝑧 =

𝑓𝑧

𝐵𝑊𝑧

Pole – zero plots and magnitude responses of the outer and middle ears

17

Outer Ear Filter Middle Ear Filter

The combined frequency response of the outer and middle ears

18

Learning Activity 2 : Impulse and Magnitude Responses

19

✓The impulse response of an auditory filter can be modelled by:

𝒈 𝒏 = 𝒌 𝒏𝑻 𝑵−𝟏𝒆−𝟐𝝅𝒃 𝟐𝟒.𝟕+𝟎.𝟏𝟎𝟖𝒇𝒑 𝒏𝑻𝒄𝒐𝒔 𝟐𝝅𝒇𝒑𝒏𝑻

where, 𝑓𝑝 is the centre frequency, 𝑇 is the sampling period (𝑓𝑠= Τ
1
𝑇 ) , 𝑛 is the discrete time sample index, 𝑁 is the order of the

filter (𝑁 = 4) and 𝑎 is a constant chosen such that the filter gain at the centre frequency is 0dB ; 𝑏 = 1.14; 𝑓𝑠= 16,000 Hz.;
[Initially, you may choose a=1 and then change the value such that the gain of the filter is normalised to 0dB at the centre
frequency, 𝑓𝑝 .

✓You are required to calculate the impulse response, 𝑔(𝑛), for four auditory filters of your choice from the low, mid and high
frequency regions of the basilar membrane using the equation {𝑓𝑝(x)} given below in MATLAB.

𝒇𝒑 𝒙 = 𝟖𝟎𝟎𝟎. 𝟎 𝟏𝟎
−𝟎.𝟔𝟔𝟕 𝒙 𝑯𝒛 𝟎 ≤ 𝒙 ≤ 𝟑. 𝟓 𝒄𝒎

✓You will notice that the impulse responses have infinite duration, and thus each impulse response will need to be truncated to,
say, 150 to 200 coefficients (i.e., 0 ≤ 𝑛 < 200). Plot the impulse responses of all four filters in the same screen. Learning Activity 2 20 (a) What major differences do you see between the impulse responses you have plotted and why? (b) Using these impulses responses, find the magnitude responses of all four filters and plot them (frequency vs magnitude in dB) on the same figure so you can compare them. (c) The gains at the centre frequencies of the filters may not be equal, choose the scaling factor ′𝑘′ for each filter (see equation of g[n]) such that the gain of each filter is normalised to 0dB at the centre frequency. (d) Approximately estimate the 3dB bandwidths of all four filters from your plots. Do they vary with the centre frequency? If so, how do you think they are related? (e) Explain your understanding of constant-Q filters and constant-Bandwidth filters. Reflections Prof. Eliathamby Ambikairajah, School of EE&T Term 3, 2021 21 ELEC3104: Mini-Project – Cochlear Signal Processing SOLO – Level 2 SOLO – Level 2 (Pass Level): Implementation of a parallel FIR filter bank model of the cochlea for analysis and synthesis purposes. Step 1: Bandpass Filter Design 22 ✓ The Cochlea can be modelled as a parallel filter bank consisting of overlapping bandpass filters covering the frequency range from 50Hz to 8kHz (Sampling frequency = 16 kHz). ✓ 128 bandpass filters (Resonant filters) with varying centre frequencies (𝑓𝑝) and quality factors (𝑄𝑝) are used to model the cochlea. The bandwidth ( ൗ 𝑓𝑝 𝑄𝑝 ) spanned by each of these filters increases with frequency. ✓ The centre frequency of the bandpass filters can be calculated using the following equation: 𝑓𝑝 𝑘 = 8000 10 −0.667 kΔ𝑥 Hz 0.0869 ≤ 𝑥 ≤ 2.9985 𝑐𝑚 ∆𝑥 = 2.9985−0.0869 𝑁−1 ≈ 0.02293 cm; N = 128; k = 1, 2,…., N; ✓ From experiments, it is known that the Quality factors 𝑄𝑝 of the bandpass filters vary linearly from 5 (Low frequency filter, n=1) to 10 (High frequency filter, n=128) ✓ The bandwidth of the nth bandpass filter is given by: 𝐵𝑊𝑝 𝑛 = 𝑓𝑝 𝑛 𝑄𝑝 𝑛 . Filter No. (𝒏) Resonant Frequency 𝒇𝒑 𝒏 in Hz 𝑸𝒑 𝒏 𝑩𝑾𝒑 𝒏 in Hz 1 𝑓𝑝 1 = 88 5 18 2 𝑓𝑝 2 =91 5.039 18 3 𝑓𝑝 3 =95 5.079 19 4 𝑓𝑝 4 =98 5.118 19 . . . . 64 𝑓𝑝 64 =811 7.520 108 . . . . 128 𝑓𝑝 128 =7723 10 772 Table 1 Note: when n=1, k= 128; n =2, k =127 ….., n =128, k=1 Step 1: Design Criteria Step 1 (continued): Bandpass Filter Design - Pole-zero placement method 23 ✓ Complete the table 1 using the equations given in the previous slide. ✓ Calculate the digital filter coefficients of the poles (𝑏1 & 𝑏2) and zeros using pole-zero placement (e.g: see diagram): ▪ Pole frequency = 𝜃𝑝; radius = 𝑟𝑝; 𝜃𝑝 = 2𝜋𝑓𝑝 𝑓𝑠 ; 𝑓𝑠 = 16 𝑘𝐻𝑧 ▪ 𝐻𝑝 𝑧 = 𝑧2−1 𝑧−𝑟𝑝𝑒 𝑗𝜃𝑝 𝑧−𝑟𝑝𝑒 −𝑗𝜃𝑝 = 1−𝑧−2 1−2𝑟𝑝 cos 𝜃𝑝𝑧 −1+𝑟𝑝 2𝑧−2 ----- (1) ▪ One section of the digital filter: 𝐻𝑝 𝑧 = 1 1−𝑏1𝑧 −1+𝑏2𝑧 −2 ----- (2) ▪ Equating the denominator of (1) and (2), we obtain ▪ 𝑏1 = 2𝑟𝑝 cos 𝜃𝑝 and 𝑏2 = 𝑟𝑝 2. ----- (3) ▪ 𝑟𝑝 and 𝐵𝑊𝑝 (bandwidth of 𝐻𝑝) can be calculated as follows: 𝑟𝑝 ≈ 1 − 𝐵𝑊𝑝 𝑓𝑠 𝜋 ; ✓ Calculate the coefficients 𝑏1 & 𝑏2 using Equation 3 above. ✓ Repeat the above calculations to obtain all 128 IIR filters {𝐻𝑝 𝑧 }. 𝐵𝑊𝑝 = 𝑓𝑝 𝑄𝑝 ; 𝑄𝑝 - Q factor Complex Pole pair and zeros placement Magnitude response of a bandpass filter with centre frequency 3171 Hz Step 1: Design Criteria (Continued) Are you on the right track? 24 Are you on the right track? Filter No. (𝒏) Resonant Frequency 𝒇𝒑 𝒏 in Hz 𝑸𝒑 𝒏 𝑩𝑾𝒑 𝒏 in Hz 𝑏1 = 2𝑟𝑝 cos 𝜃𝑝 𝑏2 = 𝑟𝑝 2 1 𝑓𝑝 1 = 88 5 18 1.9919 (4DP) 0.993 (3DP) 2 𝑓𝑝 2 =91 5.039 18 1.9916 0.993 3 𝑓𝑝 3 =95 5.079 19 1.9913 0.993 4 𝑓𝑝 4 =98 5.118 19 1.9910 0.992 . . . . . . 64 𝑓𝑝 64 =811 7.520 108 1.8589 0.958 . . . . . . 128 𝑓𝑝 128 =7723 10 772 -1.6867 0.720 ✓If your implementation is on the right track, you should observe the following impulse responses (roughly) at different IIR filters. You must also check the coefficients (b1 and b2) that you have calculated against Table 2. Table 2 Step 2: Analysis Filter Bank 25 ✓ In a filter bank analysis, an input signal is fed into a series of analysis filters (in this project we use 𝑁 = 128 filters), decomposing the signal into subbands. ✓ This means that the output signal (pm[n]) from each analysis filter represents different frequency components of the input signal. ✓ The analysis filters 𝐻𝑚(𝑧) (see diagram on the right) comprise a set of overlapping N bandpass filters used to model the human auditory filters as explained in the previous slides. ✓ The analysis filter 𝐻𝑚(𝑧) (impulse response h[n]) can be implemented in practice as an FIR filter. ✓ Once you have calculated the filter coefficients of the 128 IIR filters, use MATLAB to calculate the impulse responses of your IIR filters . ✓ You will notice that 128 impulse responses have an infinite duration (In MATLAB this is limited to around 6000 samples), and thus each filter’s impulse response should be truncated to, around 160 coefficients, in order to obtain the FIR filter coefficients of your analysis filters {𝐻1(𝑧) to 𝐻𝑁(𝑧)} {see an example shown on the right). ✓ Using these coefficients, the filters {𝐻1(𝑧) to 𝐻𝑁(𝑧)} can now be implemented as a bank of FIR filters. Step 2: FIR Analysis Filters Block Diagram of Analysis Filter Bank Step 2 (continued) : Analysis Filter Bank 26 ✓ In a filter bank analysis, an input signal is fed into a number of analysis filters (in this project we use 𝑁 = 128 FIR filters, see the diagram on the right), decomposing the signal into subbands. ✓ This means that the output signal from each analysis filter { 𝑝1[n], 𝑝2[n],..., 𝑝𝑁[n]}, represents different frequency components of the input signal x[n]. Step 2: FIR Analysis Filters Are you on the right track? ✓ If your implementation is on the right track, you should observe the magnitude responses (roughly) for the IIR filters 45 (416Hz)and 65 (840Hz) as in the diagram below. The corresponding FIR filter magnitude responses are also shown below. Magnitude & phase responses of the analysis filter 90 corresponding to the centre frequency of 2026 Hz. Note: The phase response is non- linear. IIR FIR IIR FIR 416 Hz 840 Hz IIR filter IIR filter 160 FIR filter coefficients 160 FIR filter coefficients Step 3: Analysis Filter Bank Implementation 27 ✓ For the filter with a centre frequency of 1 kHz, calculate the IIR filter impulse response h[n], truncate it to M (=160 ) coefficients and plot the magnitude response of the filter using these coefficients. ✓ On the same figure, plot the magnitude response of the corresponding 1kHz IIR filter. You may notice that the magnitude responses for the filters are not exactly the same. Discuss the reasons for this. The plot should be given with a centre frequency of the filter normalised to 0dB. ✓ Using MATLAB, plot the magnitude responses of the analysis filters (you may select 10 filters). The plot should be given with a centre frequency of each filter normalised to 0dB. ✓ Using MATLAB, filter the speech signal (saved in speech.wav and music.wav from ‘Wav files for DSP Labs’ on Moodle) sampled at 16 kHz using the analysis filter bank. The outputs of these analysis filters can then be added (σ𝑚=1 𝑁 𝑝𝑚[n]) to produce synthesised speech/music. ✓ Using the soundsc command in MATLAB, compare the quality of the reconstructed speech/music ො𝑥[n] (=σ𝑚=1 𝑁 𝑝𝑚[n]) with that of the original 𝑥[𝑛]. Discuss any noticeable differences. ✓ Now increase the FIR filter coefficients to 300 and repeat the above two steps to produce synthesised speech/music . Discuss any noticeable differences. Step 3: Implementation Block Diagram of the Analysis Filter Bank Centre frequencies of the above 10 filters: 161 Hz 245 374 570 870 1328 2026 3092 4718 7198 Hz Step 4: Synthesis Filter Bank 28 ✓ From step 3, you may have noticed that the reconstruction of the input signal 𝑥[𝑛] is achievable, by simply summing the analysis filter outputs (σ𝑚=1 𝑁 𝑝𝑚[n]). ✓ If a linear phase property is required, we need to introduce synthesis filters in each channel (see figure on the right) ✓ The analysis/synthesis filter pair for each channel is by no means independent. In fact, by specifying either the analysis or the synthesis filter response, the linear phase requirement implicitly determines the other. ✓ For a linear phase system, we need a synthesis filter 𝐺𝑚(𝑧), in each channel. The synthesis filter is a time reversed impulse response of the analysis filter, 𝐻𝑚(𝑧). ✓ By time reversing the FIR analysis filters’ impulse responses, we can form the synthesis filters (Impulse response ℎ[−𝑛]}. ✓ In this project, we choose the synthesis filters {G1(z) to GN(z)} to be the time-reversed version of the corresponding analysis filters i.e. 𝑔𝑚[𝑛] = ℎ𝑚[−𝑛] for m = 1, 2….N ✓ Each analysis filter bank output is fed to the input of the corresponding synthesis filter. The outputs of these synthesis filters can then be added to produce the synthesised speech i.e. ො𝑥[n] (=σ𝑚=1 𝑁 𝑞𝑚[n]). Step 4: FIR Synthesis Filters Analysis/Synthesis Filter Bank ℎ𝑚[n]ℎ𝑚[-n] Impulse response of the analysis filter 𝐻𝑚[z] is ℎ𝑚[n] Impulse response of the Synthesis filter 𝐺𝑚[z] is ℎ𝑚[-n] Step 4 (continued): Synthesis Filter Bank 29 ✓ The impulse responses of the synthesis filters are a time-reversed version of the corresponding analysis filters, therefore the filters are non-causal. To make the synthesis filters causal, a delay is introduced . i.e. 𝑔𝑚[𝑛] = ℎ𝑚[𝐿 − 𝑛] for m = 1, 2….N and L is the delay ✓ In our example, we use 160 coefficients, therefore L = 160. Step 4: FIR Synthesis Filters Analysis/Synthesis Filter Bank Are you on the right track? ✓ If your implementation is on the right track, you should obtain the following impulse responses (roughly) for the analysis, synthesis, and the combination of analysis & synthesis FIR filters for subband 65 (𝑓𝑝=840Hz): 𝒉[n] 𝒉 𝒏 ∗ 𝒈[n] 𝒈[n] Are you on the right track? 30 Are you on the right track? ✓ If your implementation is on the right track, you should obtain the following: (a) Magnitude and phase responses (roughly) for the analysis, synthesis, and the combination of analysis & synthesis FIR filters for subband 84 (𝑓𝑝=1640Hz) (b) Magnitude responses of the analysis and synthesis filters (10 filters). The centre frequency of each filter is normalised to 0dB. Centre Frequencies are: 161 Hz 245 Hz 374 570 870 1328 2026 3092 4718 7198 Hz (a) (b) Step 5: Analysis/Synthesis Filter Bank Implementation 31 ✓ For the synthesis filter with a centre frequency of 1 kHz, plot the magnitude response and on the same figure, plot the magnitude response of the corresponding analysis filter. Do you notice any difference? Explain what you notice? The plot should be given with a centre frequency of a filter normalised to 0dB. ✓ Using MATLAB, filter the speech signal (saved in speech.wav and music.wav from ‘Wav files for DSP Labs’ on Moodle) sampled at 16 kHz using the analysis filter bank. The outputs of these synthesis filters can then be added (σ𝑚=1 𝑁 𝑞𝑚[n]) to produce synthesised speech/music. ✓ Using the soundsc command in MATLAB, compare the quality of the reconstructed speech/music ො𝑥[n] (=σ𝑚=1 𝑁 𝑞𝑚[n]) with that of the original 𝑥[𝑛]. Discuss any noticeable differences. Explain what you notice? ✓ Now increase the FIR filter coefficients to 300 and repeat the above steps to produce synthesised speech/music. Discuss any noticeable differences. Step 5: Implementation Note: This mini project involves a substantial time commitment to successfully complete all parts. It is suggested that you commence work on this project straight away. Note: ✓ By convolving ℎ𝑚 𝑛 ∗ 𝑔𝑚 𝑛 , we can form a new analysis FIR filter bank (see diagram on the right) with a linear phase characteristic. As discussed before, the FIR filter coefficients of all the filters (𝐴1 𝑧 , 𝐴1 𝑧 , … 𝐴𝑚 𝑧 .. 𝐴𝑁 𝑧 ) are symmetrical around n= 160, as given below: A new analysis filter bank Prof. Eliathamby Ambikairajah, School of EE&T Term 3, 2021 32 ELEC3104: Mini-Project – Cochlear Signal Processing SOLO – Level 3 SOLO – Level 3 (Credit Level): Implementation of a parallel FIR filter bank model of the cochlea for spectral analysis. Complete SOLO-Level 2 first, and ensure that you are on the right track before proceeding to SOLO – Level 3 Short-time Spectrum Analyser 33 ✓ You should use the filter bank {A1(z) to AN(z)} that you have designed in SOLO-Level 2 to implement a short-time spectrum analyser. The bank of filters separates the frequency spectrum of interest (88 Hz to 7723 Hz) into N (=128) frequency bands. ✓ We can show that the spatial differentiation sharpens the transition bands of the filters in the filter bank. In this mini-project we will use two spatial differentiations. ✓ The spatially differentiated bandpass filter output is then passed through a hair cell model (a rectifier followed by a first-order lowpass filter). The output of the hair cell model is a measure of energy (E) of the signal in a particular frequency band. Ouput Energy 𝐸𝑚 is read (switch closed) once every 16 ms or so. Spatial Differentiation and Inner hair cell model 34 ✓ Spatial differentiation of the membrane displacement represents coupling between the cilia of the inner hair cells, through the fluid in the subtectorial space. ✓ Spatial differentiation refers to taking the derivative with respect to the position (along the basilar membrane). A discrete model is given by: 𝑑𝑚[n]=𝑠𝑚[n]- 𝑠𝑚+1[n] {𝑒. 𝑔. 𝑑1[n]=𝑠1[n]- 𝑠2[n]} ✓ The second spatial differentiation is given by: 𝑒𝑚[n]=𝑑𝑚[n]- 𝑑𝑚+1[n] {𝑒. 𝑔. 𝑒1[n]=𝑑1[n]- 𝑑2[n]} Spatial Differentiation ✓ The model of an inner hair cell is a capacitor model, in which the input voltage corresponds to the spatially differentiated membrane displacement output of the filter bank model. ✓ Bending the inner hair cell cilia (Half-wave rectification) is simulated by charging of the capacitor, and returning to the initial position of the cilia is equivalent to discharging the capacitor. ✓ This model is given by the following input-output relationship: 𝑣𝑚[𝑛] = 1 − 𝑐0 ǁ𝑒𝑚[𝑛] + 𝑐0𝑣𝑚[𝑛 − 1] where 𝑐0 = 𝑒 −2π 𝑓𝑐 𝑓𝑠 Where, 𝑣 𝑛 is the output electrical energy, Inner hair cell model 𝑓𝑐=30Hz; 𝑓𝑠=16,000Hz; 𝑒ǁ 𝑛 is the spatially differentiated displacement after half-wave rectification. Are you on the right track? 35 ✓ If your implementation of the spatial differentiation is correct, you should get the magnitude response similar to the one shown in the diagram on the left, for the filter 84 with a centre frequency of 1640 kHz. ✓ You might notice that the centre frequency of each filter has shifted slightly with each spatial differentiation, and the filter shapes have become sharper, with a steeper slope. Why do you think this is the case? Filter 84 (𝑓𝑝= 1.64 kHz) Are you on the right track? 36 ✓ Apply a sinusoidal signal at the input 𝑥[𝑛]. The frequency of the signal is 1.64 kHz and the number of samples is 2000 ✓ Plot the output {𝑠1[𝑛] 𝑡𝑜 𝑠𝑁[𝑛]} of each filter against the filter number at a particular time instant . ✓ Repeat the above step for the output {𝑑1[𝑛] 𝑡𝑜 𝑑𝑁[𝑛]} and for the output {𝑒1[𝑛] 𝑡𝑜 𝑒𝑁[𝑛]} ✓ Do you notice any differences between these three plots? If so, why? Explain briefly. ✓ If your implementation of the spatial differentiation is correct, you should get results that are very similar to the diagram on the left for a 1.64 kHz sinusoidal input. Before spatial differentiation After first spatial differentiation After second spatial differentiation 𝑠1 𝑛 …… 𝑠𝑁[𝑛] 𝑑1 𝑛 …… 𝑑𝑁[𝑛] 𝑒1 𝑛 …… 𝑒𝑁[𝑛] 1 1 1 Are you on the right track? 37 ✓ The figure below shows the spatially differentiated basilar membrane displacement (e1[n] to eN[n] } and the corresponding inner hair cell output in response to a sum of two sinusoidal components applied at the input (5.92 kHz and 1.64 kHz). ✓ If your inner hair cell model implementation is correct, you should observe something similar to what is shown below. ✓ The inner hair cell output shows the spectral components that present in the input signal. • Apply a signal which is a sum of six sinusoids, 1000-2000 samples, of equal amplitude and frequencies of your choice, to the input of the filter bank. Plot the output of the spectrum analyser (i.e the output of each filter in dB against the filter number) at a particular time instant. • Plot the magnitude spectrum (using FFT) of the input signal and compare it with the filter bank output. Discuss the results that you get. • Note that the sampling frequency of the input signal is 16kHz and the output signal has a sampling interval of 16ms (62.5Hz). Explain why it is necessary to have a lower sampling rate at the output? What are the implications for the cut-off of the output LPF (see hair cell model) if we require a sampling of the output (close the switch) twice as often (125Hz)? Final Implementation Project Report Format 38 ✓ The submission of a project report [2500 (5 pages) to 4000 words (8 pages)] by Monday, Week 11, 22nd November 2021 by 9:00PM. (15%). ▪ Name, student ID, date of submission, ▪ Title of the report and the SOLO level, ▪ Abstract, ▪ Description of the project, ▪ Equations, if any, and diagrams, ▪ MATLAB plots, ▪ Results, ▪ A discussion/comparative analysis demonstrating that your project implementation works as intended ▪ Do NOT include code in your report, but you must upload your m-file of the mini- project on Moodle. Fonts should be Times New Roman or Arial, and font size should be a maximum of 12 point for the body text, larger sizes could be used for the headings. Your project report should consist of :