Viotar/Quantifying the signal
From Control Systems Technology Group
(→Software Design (Quantifying the signal we want to see)) 
(→Software Design (Quantifying the signal we want to see)) 

Line 133:  Line 133:  
In order to do this we made amplitude plots in the frequency domain. This gives us information about the frequencies at which high peaks appear and what their amplitudes are. We did this for the model as well as for our measurements. When we first analyzed the model, we seemed to be right in the fact that as the tone gets better, more peaks appear in the fft spectrum. These peaks are not randomly spread out, but appear at harmonic frequencies. That is, at ntimes the fundamental frequency with n being the number of the peak. This is also made visible in the figures below. These figures show the difference between the frequency that you would expect following this rule and the frequency that comes out of the model. For an unidentifiable tone, there are no harmonic tones on the expected frequencies, as the graph runs out of the figure. For a clear Helmholtz vibration however, the rule is satisfied for nine peaks. A second thing that becomes clear by analyzing the results from the model, is that the amplitude of every next peak decreases exponentially.  In order to do this we made amplitude plots in the frequency domain. This gives us information about the frequencies at which high peaks appear and what their amplitudes are. We did this for the model as well as for our measurements. When we first analyzed the model, we seemed to be right in the fact that as the tone gets better, more peaks appear in the fft spectrum. These peaks are not randomly spread out, but appear at harmonic frequencies. That is, at ntimes the fundamental frequency with n being the number of the peak. This is also made visible in the figures below. These figures show the difference between the frequency that you would expect following this rule and the frequency that comes out of the model. For an unidentifiable tone, there are no harmonic tones on the expected frequencies, as the graph runs out of the figure. For a clear Helmholtz vibration however, the rule is satisfied for nine peaks. A second thing that becomes clear by analyzing the results from the model, is that the amplitude of every next peak decreases exponentially.  
  [[File:Model_unidentifiable.PNGframeBorderleftFigure  +  [[File:Model_unidentifiable.PNGframeBorderleftFigure 7: Amplitude ratio and frequency errors for an unidentifiable sound]] [[File:Model_helmholtz.PNGframeBordercenterFigure 8: Amplitude ratio and frequency errors for a Helmholtz vibration]] 
Line 139:  Line 139:  
When we take a look at the measurements we did, it becomes clear that these measurements are not as “clean” as the model. The same figures as for the model are also made for the measurements, as you can see below. The amplitude of the peaks does indeed decrease more or less logarithmic as we would expect from the model. The number of peaks that appear at the expected frequency however, is only three for a vibration that sounded like a Helmholtz vibration to us. This can be explained by the fact that these measurements are done using a piezo element and the string vibrates along this element instead of perpendicular to it, which gives another signal. This problem is going to be solved however because in the meantime experiments have proofed that the signal gets better when the string vibrates perpendicular, like it will on our prototype.  When we take a look at the measurements we did, it becomes clear that these measurements are not as “clean” as the model. The same figures as for the model are also made for the measurements, as you can see below. The amplitude of the peaks does indeed decrease more or less logarithmic as we would expect from the model. The number of peaks that appear at the expected frequency however, is only three for a vibration that sounded like a Helmholtz vibration to us. This can be explained by the fact that these measurements are done using a piezo element and the string vibrates along this element instead of perpendicular to it, which gives another signal. This problem is going to be solved however because in the meantime experiments have proofed that the signal gets better when the string vibrates perpendicular, like it will on our prototype.  
  [[File:Metingen_helmholtz.PNGframeBordercenterFigure  +  [[File:Metingen_helmholtz.PNGframeBordercenterFigure 9: Amplitude ratio and frequency errors for measured Helmholtz sound]] 
So, we seemed to be right in the fact that the quality of the vibration has something to do with the frequencies at which harmonic peaks appear and the amplitude of that peaks compared to that of the fundamental frequency. There is only one important thing that makes this method of quantifying the signal irrelevant for our prototype control system. The point is that for this method a fourier transformation needs to be done in the control unit in order to detect what the quality of the signal is. The problem is, that a fourier transformation cannot be done instantaneously but only when enough information about the vibration is gathered. A simple rule tells that the resolution of the fft equals 1/(sample time). In our case, where quality of the sound depends strongly on the exact frequencies where peaks appear, we should have a resolution in the frequency domain of at least 1 Hz. This means that the sample time for every fft needs to be about a second, while the vibration needs to be adapted in several milliseconds up to several hundreds of seconds at most. So, this method is simply never going to satisfy our requirements.  So, we seemed to be right in the fact that the quality of the vibration has something to do with the frequencies at which harmonic peaks appear and the amplitude of that peaks compared to that of the fundamental frequency. There is only one important thing that makes this method of quantifying the signal irrelevant for our prototype control system. The point is that for this method a fourier transformation needs to be done in the control unit in order to detect what the quality of the signal is. The problem is, that a fourier transformation cannot be done instantaneously but only when enough information about the vibration is gathered. A simple rule tells that the resolution of the fft equals 1/(sample time). In our case, where quality of the sound depends strongly on the exact frequencies where peaks appear, we should have a resolution in the frequency domain of at least 1 Hz. This means that the sample time for every fft needs to be about a second, while the vibration needs to be adapted in several milliseconds up to several hundreds of seconds at most. So, this method is simply never going to satisfy our requirements.  
Line 148:  Line 148:  
So the fact that more harmonic peaks appear in the frequency domain, finds is origin in the fact that more harmonic sinuses occur in the time domain. Moreover, when we want to quantify the signal in the time domain on the same properties as we did in the frequency domain, we only have to assess the signal on its sharpness. To proof this theory, the figures below show how the shape of the signal changes as the number of harmonic sinuses is increased. This leads to a perfectly sharp saw tooth, when the number of harmonic sinuses goes to infinity.  So the fact that more harmonic peaks appear in the frequency domain, finds is origin in the fact that more harmonic sinuses occur in the time domain. Moreover, when we want to quantify the signal in the time domain on the same properties as we did in the frequency domain, we only have to assess the signal on its sharpness. To proof this theory, the figures below show how the shape of the signal changes as the number of harmonic sinuses is increased. This leads to a perfectly sharp saw tooth, when the number of harmonic sinuses goes to infinity.  
  [[File: Sawtooth_x4.PNGframeBordercenterFigure  +  [[File: Sawtooth_x4.PNGframeBordercenterFigure 10: Sawtooth signals for an increasing number of harmonics]] 
So, the idea is that we quantify the signal on the sharpness of the sawtooth. In order to do this we adapted our model and added a possibility to generate a sawtooth that serves as a reference. The correlation between the signal and our autogenerated reference sawtooth will be used as the quantification. To find out whether the signal indeed can be quantified on its sharpness, we did some experiments. In the Helmholtz region, we varied the bowing speed at a constant bowing force and varied the bowing force at a constant speed. For all these simulations the correlation is calculated and plotted in the figures below (figures 10 and 11). From these figures, it can easily be concluded that there is not an ideal combination of bowing speed and force. That is, there is not an optimum which gives the best Helmholtz vibration. This means that when the vibration is a so called Helmholtz vibration, the system cannot be controlled to a point at which the correlation is highest. That is why we choose to make a lookup table with combinations of bowing speeds and forces that are in the Helmholtz region. The control unit then only needs to identify the fundamental frequency and lookup the right settings for the bowing speed and force. This gives great advantages regarding to adaptation time, because the controlling time now reduces to one sample time.  So, the idea is that we quantify the signal on the sharpness of the sawtooth. In order to do this we adapted our model and added a possibility to generate a sawtooth that serves as a reference. The correlation between the signal and our autogenerated reference sawtooth will be used as the quantification. To find out whether the signal indeed can be quantified on its sharpness, we did some experiments. In the Helmholtz region, we varied the bowing speed at a constant bowing force and varied the bowing force at a constant speed. For all these simulations the correlation is calculated and plotted in the figures below (figures 10 and 11). From these figures, it can easily be concluded that there is not an ideal combination of bowing speed and force. That is, there is not an optimum which gives the best Helmholtz vibration. This means that when the vibration is a so called Helmholtz vibration, the system cannot be controlled to a point at which the correlation is highest. That is why we choose to make a lookup table with combinations of bowing speeds and forces that are in the Helmholtz region. The control unit then only needs to identify the fundamental frequency and lookup the right settings for the bowing speed and force. This gives great advantages regarding to adaptation time, because the controlling time now reduces to one sample time.  
  [[File:Constant_force.PNGframeBorderleftFigure  +  [[File:Constant_force.PNGframeBorderleftFigure 11: Correlation for varying bowing speeds]] [[File:Constant_speed.PNGframeBordercenterFigure 11: Correlation for varying bowing forces]] 
Revision as of 20:43, 20 January 2011
Software Design (Quantifying the signal we want to see)With software design, we mean the way the controller is structured. There are many possibilities, but it is important to design the controller in such a way that it matches the requirements that are stated. The controller will be tested on a fixed point model of the string, so it is also important to verify that the model is accurate enough to represent the real string. Besides that, also the following questions need to be answered to come to a good software design:
In order to answer these questions, some experiments have been done. These experiments give information about what a bowed string looks like in both time and frequency domain. When we are able to find out how to recognize a pleasant (Helmholtz) sound from time and/or frequency information, this is a first step in designing an appropriate controller.
ExperimentTo measure Helmholtz motion, a measurement will be done for the Astring and the Bstring, on the open string and the 1st, 12th and 13th fret. The open string and 1st fret measurements are needed to "shift" the signal in the frequency domain, when necessary. Everything that shifts up according to the fret change is part of the vibration we want to measure, the rest is noise. With this principle we are hoping to be able to cancel the noise from the measurements. The 12th and 13th fret are done so that the same can be done for a much higher position (one octave up), because the waveform may have a different character there. To measure raucous noise and surface sound, only the open A and Bstring will be measured. That is, beacause we only want to know what these signals look like and we do not actually use them. Experiment goalThe goal of this experiment is to find out what a Helmholtz vibration and a noisy (surface or raucous) sound look like in frequency and time domain. We measure the vibration of the string in three ways. Firstly, we measure the transversal motion of the string, using a laser. This will be done because we need to know the vibration of the string at one single point, since the model also describes one point. Also the sound that you hear when the instrument is bowed is measured using a microphone. At last, the vibration at the bridge will be measured, using the existing piëzo’s. This is done because of two reasons. Firstly, we want to know the difference between the vibration of the end of the string and the vibration at a single point somewhere in the middle of it. The second reason is that the piëzo’s seem to be the best way to pick up the signal for the controller because these piëzo’s are also used as pick up element in normal electric guitars. The main goal of these measurements is that we want to know how to recognize a clear Helmholtz vibration in the frequency domain. Also the time domain information will be important, but the results for a clear Helmholtz vibration are pretty obvious here. Experiment setupThe measurement with the laser will be done using a Laboratory Interface. For the measurements with the piëzo’s and the microphone, we will use a SigLab. The experiments will be done for two different strings, the A and B string. The string will be bowed at 4 different fret positions, being the open string, the 1st, 12th and 13th fret. All the measurements will be done twice to reduce errors. ResultsIn figure 1 both the time and frequency domain results are given for what is called a raucous sound, which means that the string is sticking to much. This measurement is done using a piëzo guitar pickup. As can be seen from the power spectrum, there are no harmonic vibrations in this sound. It is all very chaotic and there is only noise. In figure 2 the results are given for what is called a surface sound, which means that the bow force is to low and the bow scratches along the string. In this figure there are some peaks that are clearly higher than others. These are the hormonic frequencies for a Helmholtz vibration as we will see later. Beside those peaks however, there is also a lot of noise in between them. This noise could be a thing that makes a surface sound recognisable later on.
Noise cancellationThe first goal was to cancel the noise from the measurements using the pitch shifting method explained in the experiment plan. This has proved to be not as simple as we have thought. The power spectrum of a measurement may be split up in two components: the 'noise' component, which stays the same when a higher note is played, and the 'harmonic' component, which shifts up when a higher note is played. They may be written as p_{n} and p_{h}, respectively, so that p = p_{h} + p_{n}. The two measurements are called '1' and '2', of which '1' will be pitchshifted towards the pitch of '2'. The shifted measurement is called 's'. will yield these equations:
These are 4 equations with 6 unknowns, so the system can't be solved. Therefore, the measurements of the 1st and 13th frets are dropped, because they are now only excess measurements. Possible controller architecturesBefore we can decide what type of controller would be best for our system, let's take a look at the possible controller architecture. The first type of controller is open loop (feed forward). This means that the controller only sends a signal to actuators without checking whether the desired requirements are achieved or not. The second architecture is a closed loop (feedback) controller. This controller compares a measured value with a predefined value and adaptes the system in such a way, untill the measured value equals the predefined value. At last, there is a combination of both. In this controller, all the known information is used to send a feed forward signal to bring the system as close as possible to the desired state. The small changes are made using the feedback signal. This controller is generally preferred above the feedback only controller because controlling on the feedback signal is mostly rather slow. Reflected on our viotar, this gives the following concepts:
All the values for bow speed and force are predefined in a lookup table for every fret. From the obtained signal, the fundamental frequency of the vibration can be determined, which is directly related to the played fret. After that, the controller looks up the right values for bow speed and force and uses it as controlvalues.
The obtained signal is compared with an ideal Helmholtz signal, and a “tone quality” is assigned. Using this rating as a feedback quantity, a closed loop is created with the goal to get an ideal Helmholtz signal from the string.
First, the right bow force and speed are determined using the lookup table, and actuated. Then, the comparison with the ideal Helmholtz signal starts, creating a feedback loop using this “tone quality”. This feedback signal is only used for finetuning the bow force and speed. A combination of feed forward and feedback theoretically leads to the best result. That's why we choose to work this concept out first. In theory this means that tone intensity and quality will be controlled in the way shown in figure 6.
Recognising Helmholtz and quantifying the signalProbaby, Helmholtz is the only harmonic vibration that you can get from a string when you bow it. With a bow you can never get a normal standing wave as when you would pluck the string. Because of this, it is not necessary to quantify "how much" the measured vibration is the specific Helmholtz waveform. It may suffit to merely quantify how harmonic the measured vibration is. This can be done by detecting the fundamental frequency in the fft of the signal, and looking looking how many multiplications of this frequency are still in the signal. The more overtones, the sharper the Helmholtz, and therefore the better the tone. In order to do this we made amplitude plots in the frequency domain. This gives us information about the frequencies at which high peaks appear and what their amplitudes are. We did this for the model as well as for our measurements. When we first analyzed the model, we seemed to be right in the fact that as the tone gets better, more peaks appear in the fft spectrum. These peaks are not randomly spread out, but appear at harmonic frequencies. That is, at ntimes the fundamental frequency with n being the number of the peak. This is also made visible in the figures below. These figures show the difference between the frequency that you would expect following this rule and the frequency that comes out of the model. For an unidentifiable tone, there are no harmonic tones on the expected frequencies, as the graph runs out of the figure. For a clear Helmholtz vibration however, the rule is satisfied for nine peaks. A second thing that becomes clear by analyzing the results from the model, is that the amplitude of every next peak decreases exponentially.
When we take a look at the measurements we did, it becomes clear that these measurements are not as “clean” as the model. The same figures as for the model are also made for the measurements, as you can see below. The amplitude of the peaks does indeed decrease more or less logarithmic as we would expect from the model. The number of peaks that appear at the expected frequency however, is only three for a vibration that sounded like a Helmholtz vibration to us. This can be explained by the fact that these measurements are done using a piezo element and the string vibrates along this element instead of perpendicular to it, which gives another signal. This problem is going to be solved however because in the meantime experiments have proofed that the signal gets better when the string vibrates perpendicular, like it will on our prototype. So, we seemed to be right in the fact that the quality of the vibration has something to do with the frequencies at which harmonic peaks appear and the amplitude of that peaks compared to that of the fundamental frequency. There is only one important thing that makes this method of quantifying the signal irrelevant for our prototype control system. The point is that for this method a fourier transformation needs to be done in the control unit in order to detect what the quality of the signal is. The problem is, that a fourier transformation cannot be done instantaneously but only when enough information about the vibration is gathered. A simple rule tells that the resolution of the fft equals 1/(sample time). In our case, where quality of the sound depends strongly on the exact frequencies where peaks appear, we should have a resolution in the frequency domain of at least 1 Hz. This means that the sample time for every fft needs to be about a second, while the vibration needs to be adapted in several milliseconds up to several hundreds of seconds at most. So, this method is simply never going to satisfy our requirements. However, there is another way to perform this method, being in the time domain. When we take a look at the sawtooth like waveform of a Helmholtz vibration, we can already in the timedomain draw some conclusions regarding to the quality of the vibration. The reason for this is that the harmonic peaks in the time domain, with their decreasing amplitudes, and the sawtoothed waveform in the time domain are strongly related to each other. A sawtoothed waveform essentially is a set of harmonic sinuses with decreasing amplitudes, being sharper when more harmonic sinuses are present. Putting this in an equation leads to the following expression for the signal, consisting of n harmonics:
So the fact that more harmonic peaks appear in the frequency domain, finds is origin in the fact that more harmonic sinuses occur in the time domain. Moreover, when we want to quantify the signal in the time domain on the same properties as we did in the frequency domain, we only have to assess the signal on its sharpness. To proof this theory, the figures below show how the shape of the signal changes as the number of harmonic sinuses is increased. This leads to a perfectly sharp saw tooth, when the number of harmonic sinuses goes to infinity.
