Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

FM Synthesis for Musical Instruments - Bells and Clarinets - Lab 5 | EE 275, Lab Reports of Digital Signal Processing

Material Type: Lab; Class: Digital Signal Processing; Subject: Electrical Engineering; University: University of Vermont; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 08/31/2009

koofers-user-njs-1
koofers-user-njs-1 🇺🇸

3

(2)

10 documents

1 / 9

Toggle sidebar

Related documents


Partial preview of the text

Download FM Synthesis for Musical Instruments - Bells and Clarinets - Lab 5 | EE 275 and more Lab Reports Digital Signal Processing in PDF only on Docsity! Signal Processing First Lab 05: FM Synthesis for Musical Instruments - Bells and Clarinets Pre-Lab and Warm-Up: You should read at least the Pre-Lab and Warm-up sections of this lab assignment and go over all exercises in the Pre-Lab section before going to your assigned lab session. Verification: The Warm-up section of each lab must be completed during your assigned Lab time and the steps marked Instructor Verification must also be signed off during the lab time. One of the laboratory instructors must verify the appropriate steps by signing on the Instructor Verification line. When you have completed a step that requires verification, simply demonstrate the step to the TA or instructor. Turn in the completed verification sheet to your TA when you leave the lab. Lab Report: It is only necessary to turn in a report on Section 4 with graphs and explanations. You are asked to label the axes of your plots and include a title for every plot. In order to keep track of plots, include your plot inlined within your report. If you are unsure about what is expected, ask the TA who will grade your report. 1 Introduction The objective of this lab is to introduce more complicated signals that are related to the basic sinusoid. These signals, which implement frequency modulation (FM) and amplitude modulation (AM), are widely used in communication systems such as radio and television), but they also can be used to create interesting sounds that mimic musical instruments. There are demonstrations on the CD-ROM that provide examples of these signals for many different conditions. nkht CD-ROM Demos FM Syn- thesis 2 Overview Frequency modulation (FM) can be used to make interesting sounds that mimic musical instruments, such as bells, woodwinds, drums, etc. The goal in this lab is to implement one or two of these FM schemes and hear the results. We have already seen that FM defines the signal x(t) as a cosine with time-varying angle x(t) = A cos(ψ(t)) and that the instantaneous frequency changes according to the derivative of ψ(t). If ψ(t) is linearly increas- ing with time, x(t) is a constant-frequency sinusoid; whereas, if ψ(t) is quadratic in time, x(t) is a chirp signal whose frequency changes linearly in time. FM music synthesis uses a more interesting ψ(t), one that is sinusoidal. Since the derivative of a sinusoidal ψ(t) is also sinusoidal, the instantaneous frequency of x(t) will oscillate. This is useful for synthesizing instrument sounds because the proper choice of the modulating frequencies will produce a fundamental frequency and several overtones, as many instruments do. The general equation for an FM sound synthesizer is x(t) = A(t) cos (2πfct+ I(t) cos(2πfmt+ φm) + φc) (1) where A(t) is the signal’s amplitude. It is a function of time so that the instrument sound can be made to fade out slowly or cut off quickly. Such a function is called an envelope. The constant parameter fc is called McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c©2003 Pearson Education, Inc. 1 the carrier frequency. Note that when you take the derivative of ψ(t) to find the instantaneous frequency fi(t), the result is fi(t) = 1 2π d dt ψ(t) = 1 2π d dt (2πfct+ I(t) cos(2πfmt+ φm) + φc) = fc − I(t)fm sin(2πfmt+ φm) + dI dt cos(2πfmt+ φm) (2) Note that fc is a constant in (2). It is the frequency that would be produced without any frequency modula- tion. The parameter fm is called the modulating frequency. It expresses the rate of oscillation of fi(t). The parameters φm and φc are arbitrary phase constants, usually both set to −π/2 so that x(0) = 0. The function I(t) has a less obvious purpose than the other FM parameters in (1). It is technically called the modulation index envelope. To see what it does, examine the expression for the instantaneous frequency (2). The quantity I(t)fm multiplies a sinusoidal variation of the frequency. If I(t) is constant or dI dt is relatively small, then I(t)fm gives the maximum amount by which the instantaneous frequency deviates from fc. Beyond that, however, it is difficult to relate I(t) to the sound made by x(t) without some rather advanced mathematical analysis. In our study of signals, we would like to characterize x(t) as the sum of several constant-frequency sinusoids instead of a single signal whose frequency changes. In this regard, the following are facts that can be demonstrated experimentally: when I(t) is small (e.g., I ≈ 1), low multiples of the carrier frequency (fc) have high amplitudes. When I(t) is large (I > 4), both low and high multiples of the carrier frequency have high amplitudes. The net result is that I(t) can be used to vary the harmonic content of the instrument sound (called overtones). When I(t) is small, mainly low frequencies will be produced. When I(t) is large, higher harmonic frequencies can also be produced. Since I(t) is a function of time, the harmonic content will change with time. For more details see the paper by Chowning.1 3 Warm-up 3.1 Chirps and Aliasing Use your MATLAB function mychirp (from Lab 3) to synthesize a “chirp” signal with the following parameters: 1. A total time duration of 2.5 secs. where the desired instantaneous frequency starts at 13,000 Hz and ends at 200 Hz. 2. Use a sampling rate of fs = 8000 Hz. Listen to the signal. What comments can you make regarding the sound of the chirp (e.g., is it linear)? Does it chirp down, or chirp up, or both? Create a spectrogram of your chirp signal. Use the sampling theorem (from Chapter 4 in the text) to help explain what you hear and see. In addition, make some theoretical calculations by hand: Determine the range of frequencies (in hertz) that will be synthesized by this MATLAB script. Make a sketch by hand of the instantaneous frequency versus time. Explain how aliasing affects the instantaneous frequency that is actually heard. Listen to the signal again to verify that it has the expected frequency content. Instructor Verification (separate page) 1Ref: John M. Chowning, “The Synthesis of Complex Audio Spectra by means of Frequency Modulation,” Journal of the Audio Engineering Society, vol. 21, no. 7, Sept. 1973, pp. 526–534. McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c©2003 Pearson Education, Inc. 2 CASE fc (Hz) fm (Hz) I0 τ (sec) Tdur (sec) fs (Hz) 1 110 220 10 2 6 11,025 2 220 440 5 2 6 11,025 3 110 220 10 12 3 11,025 4 110 220 10 0.3 3 11,025 5 250 350 5 2 5 11,025 6 250 350 3 1 5 11,025 The frequency spectrum of the bell sound is very complicated, but it does consist of spectral lines, which can be seen with a spectrogram. Among these frequencies, one spectral line will dominate what we hear. We would call this the note frequency of the bell. It is tempting to guess that the note frequency will be equal to fc, but you will have to experiment to find the true answer. It might be fm, or it might be something else—perhaps the fundamental frequency which is the greatest common divisor of fc and fm. For each case in the table, do the following: (a) Listen to the sound by playing it with the soundsc() function. (b) Calculate the fundamental frequency of the “note” being played. Explain how you can verify by listening that you have the correct fundamental frequency. (c) Describe how you can hear the frequency content changing according to I(t). Plot fi(t) versus t for comparison. (d) Display a spectrogram of the signal. Describe how the frequency content changes, and how that change is related to I(t). Point out the “harmonic” structure of the spectrogram, and calculate the fundamental frequency, f0. (e) Plot the entire signal and compare it to the envelope A(t) generated by bellenv. (f) Plot about 100–200 samples from the middle of the signal and explain what you see, especially the frequency variation. If you are making a lab report, do the plots for two cases—choose one of the first four and one of the last two. Write up an explanation only for the two that you choose. 4.4 Comments about the Bell Cases #3 and #4 are extremes for choosing the decay rate τ . In case #3, the waveform does not decay very much over the course of three seconds and sounds a little like a sum of harmonically related sinusoids. With a “faster” decay rate, as in case #4, we get a percussion-like sound. Modifying the fundamental frequency f0 (determined in part (d) above) should have a noticeable effect on the tone you hear. Try some different values for f0 by changing fc and fm, but still in the ratio of 1:2. Describe what you hear. Finally, experiment with different carrier to modulation frequency ratios. For example, in his paper, Chowning uses a fundamental frequency of f0 = 40 Hz and a carrier to modulation frequency ratio of 5:7. Try this and a few other values. Which parameters sound “best” to you? 5 Optional: C-Major Scale Finally, synthesize other note frequencies. For example, try to make the C-major scale (defined in Lab 3) consisting of seven consecutive notes. McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c©2003 Pearson Education, Inc. 5 Lab 05 INSTRUCTOR VERIFICATION PAGE For each verification, be prepared to explain your answer and respond to other related questions that the lab TA’s or professors might ask. Turn this page in at the end of your lab period. Name: Date of Lab: Part 3.1 Aliasing of the linear FM Chirp: Verified: Date/Time: Part 3.2(a),(b) Sinusoidal FM Signal Generation: Verified: Date/Time: Part 3.2(e) Explain why the Wideband FM Spectrogram has the characteristics that you observe. Does the spectrogram match your “hearing” experience when you listen to the sound in part (e)? Compare your ob- servations to the spectrogram of other signals that you have seen in the lecture or in the lab. Write a short explanation in the space below: Verified: Date/Time: McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c©2003 Pearson Education, Inc. 6 6 Woodwinds As an alternative to the bell sounds, this section shows how different parameters in the same FM synthesis formula (1) will yield a clarinet sound, or other woodwinds. 6.1 Generating the Envelopes for Woodwinds There is a function on the CD-ROM called woodwenv which produces the functions needed to create both nkht CD-ROM woodwenv.mthe A(t) and I(t) envelopes for a clarinet sound. The file header looks like this: function [y1, y2] = woodwenv(att, sus, rel, fsamp) %WOODWENV produce normalized amplitude and modulation index % functions for woodwinds % % usage: [y1, y2] = woodwenv(att, sus, rel, fsamp); % % where att = attack TIME % sus = sustain TIME % rel = release TIME % fsamp = sampling frequency (Hz) % returns: % y1 = (NORMALIZED) amplitude envelope % y2 = (NORMALIZED) modulation index envelope % % NOTE: attack is exponential, sustain is constant, % release is exponential The outputs from woodwenv are normalized so that the minimum value is zero and the max is one. Try the following statements to see what the function produces: fsamp = 8000; Ts = 1/fsamp; tt = delta : Ts : 0.5; [y1, y2] = woodwenv(0.1, 0.35, 0.05, fsamp); subplot(2,1,1), plot(tt,y1), grid on subplot(2,1,2), plot(tt,y2), grid on 6.2 Scaling the Clarinet Envelopes Since the woodwind envelopes produced by woodwenv range from 0 to 1, some scaling is necessary to make them useful in the FM synthesis equation (1). In this section, we consider the general process of linear re-scaling. If we start with a normalized signal ynorm(t) and want to produce a new signal whose max is ymax and whose min is ymin, then we must map 1 to ymax and 0 to ymin. Consider the linear mapping: ynew(t) = α ynorm(t) + β (4) Determine the relationship between α and β and ymax and ymin, so that the max and the min of ynew(t) are correct. Test this idea in MATLAB by doing the following example (where α = 5 and β = 3): McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c©2003 Pearson Education, Inc. 7
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved