Fourier Signal Analysis

Similar documents
Discrete Fourier Transform (DFT)

ME scope Application Note 01 The FFT, Leakage, and Windowing

Laboratory Assignment 4. Fourier Sound Synthesis

DFT: Discrete Fourier Transform & Linear Signal Processing

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Lecture 3 Complex Exponential Signals

Lab 0: Introduction to TIMS AND MATLAB

ME scope Application Note 02 Waveform Integration & Differentiation

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Laboratory Experiment #1 Introduction to Spectral Analysis

1 Introduction and Overview

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Here are some of Matlab s complex number operators: conj Complex conjugate abs Magnitude. Angle (or phase) in radians

Experiments #6. Convolution and Linear Time Invariant Systems

Dynamic Vibration Absorber

Lecture notes on Waves/Spectra Noise, Correlations and.

Basic Signals and Systems

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

ELEC3104: Digital Signal Processing Session 1, 2013

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

CHAPTER 4 IMPLEMENTATION OF ADALINE IN MATLAB

Real Analog - Circuits 1 Chapter 11: Lab Projects

SAMPLING THEORY. Representing continuous signals with discrete numbers

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

EE 422G - Signals and Systems Laboratory

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

Lab 3 FFT based Spectrum Analyzer

ECEGR Lab #8: Introduction to Simulink

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

DSP First. Laboratory Exercise #2. Introduction to Complex Exponentials

Lab 4 Fourier Series and the Gibbs Phenomenon

Coming to Grips with the Frequency Domain

Data Acquisition Systems. Signal DAQ System The Answer?

A Brief Introduction to the Discrete Fourier Transform and the Evaluation of System Transfer Functions

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Lab 4 Digital Scope and Spectrum Analyzer

Fall Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class

Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

L A B 3 : G E N E R A T I N G S I N U S O I D S

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

1. In the command window, type "help conv" and press [enter]. Read the information displayed.

ELECTRONOTES APPLICATION NOTE NO Hanshaw Road Ithaca, NY Nov 7, 2014 MORE CONCERNING NON-FLAT RANDOM FFT

THE CITADEL THE MILITARY COLLEGE OF SOUTH CAROLINA. Department of Electrical and Computer Engineering. ELEC 423 Digital Signal Processing

Integrators, differentiators, and simple filters

CHAPTER 6 INTRODUCTION TO SYSTEM IDENTIFICATION

ECE 2713 Homework 7 DUE: 05/1/2018, 11:59 PM

EE 791 EEG-5 Measures of EEG Dynamic Properties

1 ONE- and TWO-DIMENSIONAL HARMONIC OSCIL- LATIONS

Post-processing using Matlab (Advanced)!

A Faster Method for Accurate Spectral Testing without Requiring Coherent Sampling

Spectrum Analysis - Elektronikpraktikum

Signal Processing First Lab 02: Introduction to Complex Exponentials Multipath. x(t) = A cos(ωt + φ) = Re{Ae jφ e jωt }

System analysis and signal processing

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

Chapter 5 Window Functions. periodic with a period of N (number of samples). This is observed in table (3.1).

The Fast Fourier Transform

Problem Set 1 (Solutions are due Mon )

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

DIGITAL SIGNAL PROCESSING TOOLS VERSION 4.0

It is the speed and discrete nature of the FFT that allows us to analyze a signal's spectrum with MATLAB.

ELT COMMUNICATION THEORY

Physics 1021 Experiment 3. Sound and Resonance

(i) Sine sweep (ii) Sine beat (iii) Time history (iv) Continuous sine

Advanced Audiovisual Processing Expected Background

Reading: Johnson Ch , Ch.5.5 (today); Liljencrants & Lindblom; Stevens (Tues) reminder: no class on Thursday.

INTEGRATING AND DECIPHERING SIGNAL BY FOURIER TRANSFORM

G(f ) = g(t) dt. e i2πft. = cos(2πf t) + i sin(2πf t)

TRANSFORMS / WAVELETS

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

Response spectrum Time history Power Spectral Density, PSD

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows:


Introduction. Chapter Time-Varying Signals

Electrical & Computer Engineering Technology

EET 223 RF COMMUNICATIONS LABORATORY EXPERIMENTS

Outline. Discrete time signals. Impulse sampling z-transform Frequency response Stability INF4420. Jørgen Andreas Michaelsen Spring / 37 2 / 37

Laboratory Assignment 5 Amplitude Modulation

BIOMEDICAL SIGNAL PROCESSING (BMSP) TOOLS

Engineering Thesis. The use of Synchronized Phasor Measurement to Determine Power System Stability, Transmission Line Parameters and Fault Location

6.02 Practice Problems: Modulation & Demodulation

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Objectives:

Discrete Fourier Transform

6 Sampling. Sampling. The principles of sampling, especially the benefits of coherent sampling

4 Experiment 4: DC Motor Voltage to Speed Transfer Function Estimation by Step Response and Frequency Response (Part 2)

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

Introduction to signals and systems

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

EXPERIMENT 8: LRC CIRCUITS

Fourier Theory & Practice, Part I: Theory (HP Product Note )

MTE 360 Automatic Control Systems University of Waterloo, Department of Mechanical & Mechatronics Engineering

LAB #7: Digital Signal Processing

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Signal Processing for Digitizers

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Physics 115 Lecture 13. Fourier Analysis February 22, 2018

LabVIEW and MatLab. E80 Teaching Team. February 5, 2008

Harmonic Distortions Analyzer for Power Rectifiers

Transcription:

Part 1B Experimental Engineering Integrated Coursework Location: Baker Building South Wing Mechanics Lab Experiment A4 Signal Processing Fourier Signal Analysis Please bring the lab sheet from 1A experiment 7 with you to this lab. 1 Aims & Objectives This experiment introduces some practical applications of the theory covered in Part 1 Maths and Signals. It introduces software spectral analysis (using Octave/Matlab) and uses this to investigate the response of a vibrating system. Issues of choice of sample rate and aliasing distortion will be addressed. 2 Background This experiment is part of the integrated coursework project on the behaviour of buildings in earthquakes. Part 1A experiment 7 looked at the vibration modes and natural frequencies of a model structure. In many experimental situations raw data is captured as a series of time-varying signals (such as force, or acceleration). Very often, this data will require some form of processing before it can be interpreted. This lab session looks at one very common type of transformation: converting signals from the time domain into the frequency domain with a Fourier transform. Fourier series, covered in Part 1 Mathematics, are a means of accomplishing this conversion by decomposing a periodic signal into sine waves. Fourier transforms extend this idea further. 3 Introduction In this experiment, you will output various signals from a PC to the model structure (via the analogue/digital converter and amplifier). Simultaneously, the output from the accelerometers and force transducer are logged on the PC. Once logged, you can process these signals; for example, converting them into the frequency domain. Fourier transforms are not the only means of transforming time-domain signals into the frequency domain, but they are the most widely used. This experiment covers the use of Fourier transforms on digital data, i.e. a data signal composed of discrete points (as opposed to the series covered in 1A, which operated on a continuous signal). It comprises the following activities: 1. Use Octave/Matlab to capture signals from the experimental rig (in response to a sine wave) and display them on a PC (in the time domain). Comment on the form of these signals. 1

2. Use a Fourier transform to view these signals in the frequency domain, taking into account the length of the sample used. 3. Repeat steps 1 and 2 for a signal composed of two sine waves. 4. Compute the transfer function of the system in response to a sine-sweep, sampling above the Nyquist rate of the system. 5. Investigate the effect of aliasing by altering the sample rate. 6. Construct a periodic noise input signal as a summation of sinusoids and analyse the response of the system to this input. 7. Write a DFT algorithm and compare the time this takes to run compared to the in-built FFT. 4 Procedure 4.1 Setup This section outlines the general procedure for sending a signal to the card and capturing data from it. You will have to adapt it slightly for each objective. At any point, you can type help [command] to get a short description of any Matlab command (including built-in ones). A page is attached at the end of this lab sheet which gives an outline of the specific functions available for this lab. 4.2 Setting up Matlab The software in this experiment makes use of the functions built into Matlab s data acquisition toolbox. Some extra functions have been written specifically for this lab. First, logon to the PC using your teaching system username and password. To use the extra functions, start Matlab, then change its working directory (the box at the top in the centre) to Z:/1B A4. If for any reason you need to get these files again, they can be downloaded from clicking on the link to Div F IB laboratory information on http://www.eng.cam.ac.uk/teaching/index-ib To start the experiment and set up the A/D converter card, start Matlab and run the command initialise. This sets up the converter card and creates two Matlab objects in and out. Call the function setiorates([time],[sampling rate]); this sets the card to sample for the desired time (in seconds) and sampling frequency in Hz (for example, setiorates(10,300) ) and also creates the variable t, used in generating the data signal. NB it is important to run this command before generating the data signal, so the signal has the right sampling frequency. Create an output signal data out to send to the card. For example, the command data out = sine(5) will create a sine wave of frequency 5 Hz and store it in the data out variable. The command run takes the data stored in data out and sends this to the card. It stores the input data (signal sent to the card from the structure) as the vectors data chn (where n is the number of the channel on the card). The script analyse1 takes the input and output data and displays them on the screen. 2

5 Experiment 5.1 Objective 1 Carry out the above procedure using a single sine wave with appropriate times and sampling rates. For now, you are going to study the system in its harmonic state, so the time should be long enough to let any initial transient response decay (this can be determined by looking at the signal recorded after the test). To avoid a phenomenon called aliasing, a suggested sampling rate is 300 Hz. (Hint: for an appropriate sine wave frequency to use, look at the typical range of frequencies analysed in the 1A lab.) Make yourself familiar with the operation of the card and the associated Matlab functions. Investigate using data out =sine(5) and data out=sine(10) as the data sent to the card. Plot the results of the input and output signals on screen. (You can do this either using Matlab s built in plot functions, which gives you more control over the output, or the analyse1 function which does most of it for you with appropriate settings.) Repeat this using a superposition of two sine waves as the signal (e.g., data out = sine(5,10) ). The response of different floors may be observed by changing the channel selector on the amplifier to look at the response of the structure, channel 1 should be set to the force transducer, though you can also experiment with other combinations later. You may notice that the system runs for longer than expected: this is deliberate. The run function actually sends the data twice and logs the response during the second set. This is so that the initial transient response has time to die away and the signal analysed is (nearly) periodic. You can look at the run function to see the details if you wish. Sketch the responses to the single sine wave and the superposition of two sine waves, and comment on any noteworthy features: amplitude amplitude time time 5.2 Objectives 2 & 3 Objective 1 looked at the signals in the time domain, here we look at the signals in the frequency domain. Use the function analyse2 to plot the discrete Fourier transforms of the generated signals (eg 3

sine(5),sine(10) and sine(5,10)) and their responses. This function takes the Fourier transform of each signal and scales and plots the results. Look at the position of the peaks in response to a single sine wave and a combination of sine waves also try it with more than two. You should also comment on the amplitudes of the peaks in the spectrum of the response. You will probably notice that there are a number of artefacts present in the transform that you may not expect from the initial signal - these are explored in more detail in the extended exercise on windowing. Some of these are due to a process known as spectral leakage; this occurs as the signal is only sampled for a finite time. Sketch the transforms of the force and the acceleration responses of the structure, and comment on the significance of the peaks: Fourier transform (channel 1) Fourier transform (channel 2) 5.3 Objective 4 Make sure you are familiar with the previous sections and the operation of the system. Use this knowledge to record the transfer function of the system in response to a sine sweep. Set the sampling time to a suitable time to allow initial transients to decay and the sampling rate to a suitable value, ensuring that the sampling rate is at or above the Nyquist frequency (twice the highest frequency of interest).the command sweep will generate the output data for you, and transfer will compute the transfer function of the building (i.e. channel 2 / channel 1. How does this compare with the plot obtained in 1A?). Compare the response-frequency plot with the one you obtained manually (in 1A experiment 7), especially the location of the peaks - the resonant frequencies. How does this compare with the plot obtained in IA? 5.4 Objective 5 Try the above section again, this time changing the sample rate. What do you notice when you sample at a much lower rate (make sure you try sampling so the Nyquist rate is below the highest resonance)? Sketch and comment on the differences between this plot and the previous one, noting the sampling rates used. 4

amplitude frequency amplitude frequency 5.5 Objective 6 This part of the lab involves generating an arbitrary signal as a summation of sine waves. Use the random sum function to do this - have a look at the code to see exactly what is going on. Essentially, it is adding together a sequence of sine waves with frequencies up to the Nyquist rate, and giving each one a random phase. A suitable sample of code might be: setiorates(10,300); data out=random sum(); run; transfer; Note the signal to noise ratio might be such that you will need to amplify the signals (eg data out=10*data out). Plot this signal - is it what you might expect? Repeat the analysis in Objective 4, using this signal which has many different frequency components. What do you notice about the Fourier transform of the signal, and the response of the structure? Sketch the Fourier transform for channels 1 or 2 and the corresponding transfer function. 5

Fourier transform for channel 1 or 2 Transfer function 5.6 Objective 7 Open the fourier function in the m-file editor; you will see that, to start with, it contains the single command fft(x) (as well as the other lines declaring it as a function). This is an in-built function that performs a Fast Fourier transform. This is a particular algorithm to calculate the discrete Fourier transform of a digital signal. (See appendix for more details.) Replace this with your own algorithm to calculate a discrete Fourier transform (the DFT algorithm - see appendix A). Uncommenting the lines with cputime in will display the time taken for the intervening calculations; try it for both the fft algorithm and a simple DFT and compare the results. (Especially for the fft algorithm, this may display zero time taken with small data series this doesn t necessarily mean it s not working. To get a better result, you could try running each algorithm inside a for loop, e.g. 20 times, and compare them again.) Write down your code for the DFT: What is the difference (as an order-of-magnitude factor) between the time taken for the FFT and the algorithm you have just written? 6

Appendix A The Discrete Fourier Transform The frequency analysis of a periodic function was covered in Part IA Mathematics. You will recall that if x(t) is a periodic function with period T, then x(t) may be written as the infinite Fourier series: x(t) = a 0 2 + ( ) ( ) 2πnt 2πnt a n cos + b n sin T T n=1 (1) where a n = 2 T T 0 ( ) 2πnt x(t) cos dt and b n = 2 T T T 0 ( ) 2πnt x(t) sin dt (2) T If the Fourier coefficients are written as a single complex number c n with real part representing the coefficients of the cosine series and imaginary parts representing coefficients of the sine series, we can write the complex form of the Fourier series as x(t) = + c n e ( j2πnt T ) with c n = 1 T T 0 j2πnt ( x(t)e T ) (3) n = 0, 1, 2... We can then extend the ideas of a frequency decomposition to non-periodic signals via the Fourier Transform so that the equivalent of the above discrete equations becomes: X(ω) = x(t)e jωt dt x(t) = 1 X(ω)e jωt dω (4) 2π In order to perform the Fourier transform above by digital computer, it is convenient to sample the arbitrary function x(t) at a series of regularly spaced times to form a series of discrete values which we write as {x m }, where x m = x(m ) and m = 0, 1,..., N 1. It can then be shown that if we imagine our set of N samples is actually a periodic repetition of these N samples, we can find an invertible discrete transform which approximates the Fourier series as follows: 7

N 1 i2πkn ( X k = x n e N ) k = 0, 1, 2,..., N 1 (5) x n = 1 N n=0 N 1 k=0 X k e ( i2πkn N ) n = 0, 1, 2,..., N 1 (6) Equation 5 is known as the Discrete Fourier Transform or DFT and equation 6 is the Inverse Discrete Fourier Transform. The Fast Fourier Transform (FFT) Because of its importance in signal analysis, a great deal of effort has gone into implementing the equations in 5 and 6 efficiently. An algorithm called the Fast Fourier Transform is now almost universally used for this purpose. Octave/Matlab for loops You may find that you want to use for loops when programming the DFT alogrithm; the syntax for these in Matlab is different to C++, but they function in a similar way. Using a vector, the syntax is as follows: for x=1:1:100 statements... end This steps through the values 1, 2,3 etc. up to 100, i.e from 1 to 100 in steps of 1. 8

Table 1: Matlab Help initialise in out data chn (e.g. data ch1, data ch2 etc.) data out run setiorates(time,rate) sine(frequency1, frequency2...) sweep(frequency1, frequency2) random sum analyse1 analyse2 transfer fourier(signal) Type this at the beginning of the session; sets up the drivers to communicate between Matlab and the data acquisition card. The Matlab object representing the input card. The Matlab object representing the output card. Vectors containing the signal as recorded by the input cards. The signal sent to the output card. This command takes the data stored in data out and sends it to the output card; simultaneously it records the signal on the cards input channels. This sets the sample time and sampling frequency for the input card, and the sampling frequency for the output card. Run this command before generating data out so that the output data has the correct sampled frequency. This generates a sine wave at the specified frequency. The sampling rate is determined by the t variable set in setiorates. If more than one frequency is given, the output is a superposition of the desired frequencies. Generates a sine sweep, starting at f1 and finishing at f2. This generates a signal with frequency components from 1/sample time to the Nyquist frequency, with random phases. This function takes the recorded signals and displays them graphically. This function plots the real part of the Fourier transform of the input and output signals. This script calculates the transfer function of the system and plots the response versus frequency diagram. This function performs the Fourier transform of the function argument. 9