Presentation is loading. Please wait.

Presentation is loading. Please wait.

Auto-tuning for Electric Guitars using Digital Signal Processing Pat Hurney, 4ECE 31 st March 2009.

Similar presentations


Presentation on theme: "Auto-tuning for Electric Guitars using Digital Signal Processing Pat Hurney, 4ECE 31 st March 2009."— Presentation transcript:

1 Auto-tuning for Electric Guitars using Digital Signal Processing Pat Hurney, 4ECE 31 st March 2009

2 Outline of Presentation Project Background Aims of Project System Overview Research, Development and Testing of Functions used in Developing the System Pitch Detection Pitch Manipulation VST Development Project Conclusion Summary of Goals Possible Future Work Questions

3 Project Background Tuning problems are a large problem for guitarists, both professional and amateur Can be hard to correct in a live environment due to a variety of factors. Numerous hardware methods have been used to try and prevent tuning loss in guitars but these still don’t completely prevent it This system aims to develop a system capable of digitally correcting the pitch offset of the guitar with the use of a VST

4 Project Overview Signal from Piezo Saddles sent to Firepod interface Pitch altered Signal sent to Guitarists Rig One signal sent in to auto-tune VST for correction Piezos located on bridge

5 Pitch Detection An FFT was used to determine the pitch of the guitar signal An FFT was used on blocks of 8000 samples, sampled at 16 kHz to acquire the Magnitude Spectrum of the guitar signal. The fundamental frequency was then determined from this by determining the position of the first significant peak in the signal Highest peak was not used to determine fundamental as 2 nd and 3 rd harmonics are tallest peaks for small window of time The resolution used with the FFT varied depending on the approximate location of the fundamental frequency The location of the fundamental was approximated with the use of LP, BP and HP filters The fundamental has the highest energy content in the note If the highest energy content was present in the low pass filter, the fundamental is located here and a resolution of 8192 is used

6 Pitch Detection - Filtering Example of filters and cut-off frequencies: If a 110Hz wave was input to the system, its fundamental would lie in the range of the low-pass filter. A resolution of 8192 would then be used 8192 filter4096 filter2048 filter

7 Pitch Detection - Testing The cut-off frequencies used in the filters were determined through testing the signal Signals ranging in pitch from 110Hz to 660Hz had FFTs of varying resolutions,(8192-1024), performed on them This testing showed that low frequencies, from <82Hz to ~170Hz require a large resolution of 8192 for accurate results

8 Pitch Manipulation Pitch of out-of-tune guitar signal is corrected with the use of a phase vocoder A MATLAB implementation of a phase vocoder was discovered through research. This was then tested to determine how accurate it was at manipulating pitch, and how natural sounding the notes were Flow of Phase Vocoder Block of 8000 samples Windowing STFT Spectral Manipulation ISTFT Overlap Add Pitch-shifted Signal

9 Pitch Manipulation - Testing Testing carried out in MATLAB by strumming the guitar and determining how much the guitar goes out-of-tune by Strummed softly, max drop in pitch = 2.6Hz Strummed hard, max drop = 10.85Hz These results show that strumming the guitar hard causes a much larger drop in pitch then soft strumming Auditory testing was carried out to determine how natural sounding the pitch shifted note from the phase vocoder was Max pitch shift capable ~ 1.8-2.0 semitones Large pitch-shifts are not possible with the phase vocoder as the spectral envelope of the reconstructed signal has been changed resulting in unwanted sounds in the finished signal

10 VST Development A VST (Virtual Studio Technology) was used to implement the pitch algorithms in real-time This required re-coding the pitch algorithms in C++ for compatibility with the Steinberg VST SDK The VST is run from a DAW (Digital Audio Workstation) The DAW selected for the project was REAPER. This is a free user-friendly application that is compatible with most free and commercial VSTs

11 VST Development Two main functions in guitar auto-tuning C++ source code VST constructor processReplacing Variables declared in header file are initialised in main constructor. Other classes called in the main VST, such as the FFT and phase vocoder classes, are also initialised here The input audio stream is manipulated in the processReplacing function before being passed out to the output stream The input audio stream consists of a buffer of 1024 samples rather then a continuous stream of samples. Once these 1024 samples are processed, the next block of samples is passed in to be processed by the VST

12 VST Development - Operation Two modes of operation available to user: Mode One determines tuning offset of selected string Mode Two continuously corrects tuning offset with phase vocoder If Mode One is enabled, the system accumulates 8000 samples when the selected open string is struck. The tuning offset is then calculated from this and stored for future use If Mode Two is enabled, the tuning offset determined from Mode One is used to correct the pitch of the out-of-tune string

13 VST Development - Operation Example of System UI, with Low E Pitch Detection enabled is shown below

14 VST Development - Problems CPU usage is a major factor in the system. A large amount of CPU power is used in: Filtering – 3 5 th Order Butterworth Filters Large FFT – 8192 resolution on block of 8000 samples Six independent channels being run in VST to process each string individually Input/Output Latency is also a large factor in the system. Standard Windows audio drivers have a latency of approximately 447ms. This was solved with the use of the ASIO driver ASIO4ALL. This has a latency of approximately 13ms.

15 Conclusion Aim of project was to develop a VST system capable of correcting the pitch of an out-of-tune electric guitar signal Both algorithms embedded in C++ in a VST format Pitch Manipulation algorithm runs in real-time, Pitch Extraction algorithm not fully implemented due to time constraints Research performed in MATLAB has proven concept of auto-tuning guitar system

16 Future Work Wireless link could be implemented between piezos and interface Error handling needs to be embedded in VST to prevent two sliders being turned on for the strings

17 Questions?


Download ppt "Auto-tuning for Electric Guitars using Digital Signal Processing Pat Hurney, 4ECE 31 st March 2009."

Similar presentations


Ads by Google