Sound in Matlab & Cogent

Slides:



Advertisements
Similar presentations
Db Decibels Decibels. "A" Weighting Attenuates the lower frequencies to approximate the response of the human ear, which is most sensitive to frequencies.
Advertisements

© 2010 Pearson Education, Inc. Conceptual Physics 11 th Edition Chapter 21: MUSICAL SOUNDS.
Musical Sounds Physical Science101 Chapter twenty Amanda Hyer.
Learning Introductory Signal Processing Using Multimedia 1 Outline Overview of Information and Communications Some signal processing concepts Tools available.
Chp 13 Sound and Music.
MATLAB Stochastic Simulations Wednesday, 9/13/2002.
Analog Communications
Analog Representations of Sound Magnified phonograph grooves, viewed from above: When viewed from the side, channel 1 goes up and down, and channel 2 goes.
Area of triangles.
Sound Synthesis Part II: Oscillators, Additive Synthesis & Modulation.
Sound and the Codec Output On the DE2. Sound Sound is transmitted in air through compressions and rarefactions (stretches) of the air. This can be represented.
Sampled Audio. We store digitised audio samples. This is the main audio data. In a file (e.g..wav format) we also need some header information. We will.
Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Intermediate Course (4) Transmitters Karl Davies East Kent Radio Society EKRS 1.
EEG Probe Project Grant G. Connell. EEG Probe Project Design Objectives –Investigate BCI for severely handicapped individuals –Use time, frequency, and.
Double Side Band Suppressed Carrier
True or False? 20 questions.
True or False? 20 questions.
True or False? 20 questions. Question 1 Sound is a transverse wave.
Interface between Velleman PCSGU250 and MATLAB
Introduction to Matlab
Analog and Digital Signals AD/DA conversion BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Feb 5 Lesson 3.
Welcome to MATLAB DigComm LAB
Audio Compression ADPCM ATRAC (Minidisk) MPEG Audio –3 layers referred to as layers I, II, and III –The third layer is mp3.
Audio Programming With Python Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Lab5 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 09 March 07.
Sound, Part 3. Multiple Echoes Here is a recipe to create multiple echoes: def echoes(sndfile, delay, num): s1 = makeSound(sndfile) ends1 = getLength(s1)
SOUND with MATLAB. SOUND INPUT [a, fa, na]= wavread(’mim wav') Sound data Sampling Frequency #bit representation.
CMPS1371 Introduction to Computing for Engineers PROCESSING SOUNDS.
What makes a musical sound? Pitch n Hz * 2 = n + an octave n Hz * ( …) = n + a semitone The 12-note equal-tempered chromatic scale is customary,
IP Frequency and pitch © Oxford University Press 2011 Frequency and pitch.
Digital audio recording Kimmo Tukiainen. My background playing music since I was five first time in a studio at fourteen recording on my own for six months.
Ira Fulton School of Engineering Intro to Sinusoids What is a sinusoid? » Mathematical equation : Function of the time variable : Amplitude : Frequency.
Chapter 13 Sounds and signals basics of computer sound perception and generation of sound synthesizing complex sounds sampling sound signals simple example.
Digital Voice Communication Link EE 413 – TEAM 2 April 21 st, 2005.
Our Goal for Today Record vowel sounds onto PC’s Record vowel sounds onto PC’s Analyze using Matlab Analyze using Matlab Identify characteristics of what.
Telecommunication 1.3 – Radio and Television. Radio and TV Receivers The parts of a radio and TV receiver can be represented by a block diagram. Write.
Digital to Analogue Conversion Natural signals tend to be analogue Need to convert to digital.
Fall 2004EE 3563 Digital Systems Design Audio Basics  Analog to Digital Conversion  Sampling Rate  Quantization  Aliasing  Digital to Analog Conversion.
Lecture # 22 Audition, Audacity & Sound Editing Sound Representation.
Art 321 Sound, Audio, Acoustics Dr. J. Parker. Sound What we hear as sound is caused by rapid changes in air pressure! It is thought of as a wave, but.
Descriptive Statistics I: By the end of this class you should be able to: Palm: Section 7.1, 7.2 Program cords and delays in your music programs plot a.
COSC 1P02 Introduction to Computer Science 4.1 Cosc 1P02 Week 4 Lecture slides “Programs are meant to be read by humans and only incidentally for computers.
6.9 How radio works 22 October 2015 What is this image? What other information can you get from it?
Contents Introduction ( P1-P4). Frequency modulation.(P5-P7) Frequency demodulation (P8-P14) FM using simulink implementation (P15 – P 17)
EECE 252 PROJECT SPRING 2014 Presented by: Peizhen Sun Nor Asma Mohd Sidik.
Sonia Hingorany & Liza Cyriac EE113D – Professor Rajeev Jain & TA Rick Huang– Winter 2008.
Chapter 21 Musical Sounds.
Cis303a_chapt08.ppt Copyright© 2002 Morris Fulcher Chapter 8 Data and Network Communication Technology Communications Protocols Message A unit of data.
Chapter 2 Fundamentals of Data and Signals
EET260 Frequency Modulation. Modulation A sine wave carrier can be modulated by varying its amplitude, frequency, or phase shift. In AM, the amplitude.
CHAPTER 4 COMPLEX STIMULI. Types of Sounds So far we’ve talked a lot about sine waves =periodic =energy at one frequency But, not all sounds are like.
Calculating Wave Speed
Antenna and Microwave Laboratory Babol Noshirvani University of Technology Antenna and Microwave Laboratory Babol Noshirvani University.
Lecture 2: AM Transmission
Session 18 The physics of sound and the manipulation of digital sounds.
Design of a Guitar Tab Player in MATLAB Background Lecture
Measurement and Instrumentation
Bryant Tober. Problem Description  View the sound wave produced from a wav file  Apply different modulations to the wave file  Hear the effect of the.
FUNCTION GENERATOR.
Modulation and Multiplexing Broadband Transmission – A carrier is a high frequency signal that is modulated by audio, video, or data. – A radio-frequency.
Communications Engineering 1
Math.375 V- Interpolation 3 >Sounds and Fourier< >analysis< Vageli Coutsias.
Hearing and Mechanoreceptors
Figure Hz sine wave to be sampled.
Net 222: Communications and networks fundamentals (Practical Part)
Notes 21.1 – Properties of Sound
Sound in Matlab & Cogent
Intensity Waves and Sound
Modulation Lab 2 – 2019/1440 By: Elham Sunbu.
Presentation transcript:

Sound in Matlab & Cogent Tobias Overath

Sound sound = pressure wave

Overview play sound in Matlab/Cogent create a sound things you can do with sound: louder/quieter higher/lower combine sounds compose & play a melody

Playing a sound in Matlab load wavfile y = wavread(‘filename.wav’); play wavfile sound(y,Fs) if unsure which Fs [y, Fs, nbits, opts] = wavread(‘filename.wav’) write to disk wavwrite(y,Fs,’filename.wav’)

Playing a sound in Cogent config_sound(nchannels,nbits,Fs,nbuffs) nchannels: 1 = mono, 2 = stereo nbits: e.g. 16 Fs: sampling frequency (e.g. 44100) nbuffs: number of buffers wavfilename = [‘filename.wav’]; loadsound(wavfilename, buffer number) playsound(buffer number) waitsound(buffer number) otherwise next command will be executed immediately)

creating a sound in Matlab Fs = 44100; t = [0:1/Fs:1-1/Fs]; %1 second, length 44100 freq = 400; % Hz f1 = sin(2*pi*freq*t); sound(f1,Fs) f2 = sin(2*pi*(2*freq)*t); sound(f2,Fs) period: 1/freq (*Fs) figure(1);plot(f1) figure(2);plot(f1(1:round(1/freq*Fs+1)))

play together/superimposed: play consecutively f12 = [f1 f2]; sound(f12,Fs) play together/superimposed: f_12 = [f1+f2]; or: f_12 = sum([f1;f2]); sound(f_12,Fs);

making a sound louder/quieter f = sin(2*pi*freq*t) standardise sound f = f-mean(f); f = f/std(f); scale sound amplitude = .2; f = amplitude * f; 10^0.5 for every 10dB e.g. 10^1.0  20 dB louder e.g. 10^-1.5  30 dB quieter do not be put off by warning ‘data clipped’ message. Wavwrite needs an input vector in the range –1 to +1, else it will clip. The warning means that you have sounds that are 1 or –1 but the clipping will leave them unaltered

create noise y = .2*randn(1,Fs); sound(y,Fs)

FM sweep f = chirp(t1,f1,t2,f2); f = chirp(t,freq,1,2*freq); t1 = vector t = [0:1/Fs:1-1/fs]; f1 = initial frequency f2 = final frequency t2 = time at which f2 is reached f = chirp(t,freq,1,2*freq); sound(f,Fs)

AM sound freq = 400; % carrier frequency fm = 10; % modulation frequency f_c = sin(2*pi*freq*t); f_m = sin(2*pi*fm*t); f_mod = [f_c .* f_m]; sound(f_mod,Fs)

square wave x = square(t,duty cycle) freq = 10; duty cycle = % of signal that’s positive freq = 10; fsq = square(2*pi*freq*t); fsq = square(2*pi*freq*t, 80);

plot signal plot(t,f)

scale 12-split equitempered octave f(n) = sin(2*pi*freq*2^(n/12)*t) for example n=[0:12]; % 12 semitones for i=1:length(n) f(i,:) = sin(2*pi*freq*2^(n(i)/12)*t); end fs=[]; for i=1:13 fs = [fs f(i,:)]; fs=fs-mean(fs); fs=fs/std(fs); fs=.2*fs; sound(fs,Fs)