Connect with us

Signal Processing

Discussion in 'General Electronics Discussion' started by asifadio, Oct 4, 2012.

  1. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    Can anybody help me with signal processing related? or i in the wrong thread?
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    possibly.

    If you ask the question we will have a much better chance of knowing if we can answer it and if it is in the correct place.
     
  3. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    thank you and sorry for asking like that.. ok here is my problem

    I want to model a mathematical representation for audio signal ( ie. guitar and piano played at note C).. and as you know, even i played in the single note on a single string, it still consist of multiple harmonics/overtones instead of only a fundamental frequency(note C)
    and im using a harmonic filter bank.. these are the equations

    [​IMG]
    where
    [​IMG]

    as you can see, i need to know what are the tau or the time for each harmonics/overtones to occur..

    i been using spectrogram in audacity
    [​IMG]

    and as shown in the picture, in spectrogram, all the harmonics/overtones occur in the same initial time..

    please help me.. if you don't understand what is my problem, please let me know
    thanks a lot
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    I don't understand it, but maybe someone else will.

    By the way, his isn't homework is it?
     
  5. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    oh ok sir..
    nope.. actually im a physics student.. i never have a proper education about signal processing.. this is for supportive subject for my undergraduate thesis
     
  6. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    oh and one more thing.. here i give you all the reader a simple explanation about my problem.. i know to get a spectrogram, one need to do STFT and from STFT the he/her get, the spectrogram is presented.. now i want to do a STFT of the signal.. not in my purpose to develop a STFT-spectrogram..

    how can i do STFT while not knowing the tau or period of oscillation of harmonics/overtones within it?
     
  7. BobK

    BobK

    7,642
    1,662
    Jan 5, 2010
    A Fourier transform over say a 100msec interval will give you a frequency resolution of 10Hz. Over 10msec the resolution would be 100Hz. So there is, unfortunately, a tradeoff between how long an interval you use (time resolution) and the frequency resolution (which is the mathematical basis of the Heisenberg uncertainty principle, when applied to wave functions).

    If you need to know the exact freqencies (ie. how they deviate from the exact C note) as a function of time, you are limited by this resolution.

    However, if you are only interested in the the relative strength of the harmonics of a perfect C note, you can use 1 period as an interval, and the results of the Fourier transform will be the phase and amplitude at each of the harmonics of your C note, or I should say good approximations since the actually frequency will vary from the ideal.

    Bob
     
  8. Merlin3189

    Merlin3189

    250
    69
    Aug 4, 2011
    I too am not sure what you are asking. But in a way, the question is its own answer!
    Harmonics are by definition multiples of the fundamental frequency. So for a note of any frequency, all the harmonics will be at exact multiples of that frequency.
    Eg. if you play a C at 260Hz, then the harmonics will be at 520,780,1040,1300,1560,... etc.
    The only question is the relative amplitudes. Generally they get smaller as the multiple increases, but some instruments favour odd harmonics or even harmonics. A piano has a fairly even spread of harmonics, but the harmonics on a guitar note depend a lot on how and where it is plucked. The exact distribution will vary from one instrument to another, from one player to another and, even for one instrument and one player, from one note to the next!

    As BobK says, Fourier transforms of real waveforms are susceptible to all sorts of errors and approximations. But that hardly matters to a first approximation, as there is no single right answer. When you identify the main components, then you can experiment with variations if you want. And listen to the results to decide for yourself what makes it sound like the instrument you want.
     
  9. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    thanks a lot Bob.. really appreciate your help..
    you mean a gabor limit? actually i don't need to have a good approximation for my analysis(but i prefer to have higher msec to get a frequency precisely).. what i need is only a period of other frequencies(harmonics) that exist in the signal.. in http://en.wikipedia.org/wiki/Short-time_Fourier_transform, you can see example of gabor limit spectrogram.. that signal used, i believed is from separated signal (10, 25, 50, 100 Hz) mapped by piecewise function and represented in spectrogram.. however in my case, signal that presented is not like that.. the fundamental frequency, harmonics and undertones accumulate at t=0.. so, if i set my spectrogram in higher msec window, can i eliminate the undertones?

    and my last question is, are the fundamental frequency and harmonics/overtones start at the same time in music timbre?

    did you mean, relative strength = amplitude(dB)? can you elaborate more about ' Fourier transform will be the phase and amplitude at each of the harmonics of your C note'

    by the way Mr Bob, you are really helping me.. thank you so much!
     
  10. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    thank you Mr Merlin.. thank you for your reply
    yes, this is what im looking for.. the guitar frequencies composition is differ from piano.. i mean not all harmonics/overtones consist present in the timbre.. but, did all the frequencies start at the same time for music timbre? as i get in my spectrogram, all the frequencies (fundamental frequency, harmonics/overtones and undertones) start at t=0..

    what i believed is that the decreases of relative amplitude is given in my heterodyne function as i show in my first post.. the existence of exponential.. as the frequencies getting increase(represented by kfa), the amplitude getting smaller.. 1 question Mr Merlin, when you look at my equation (heterodyne function), what actually the use of window function exist in it? i know that window function is to localize interested signal base on our temporal selection(where outside of the interval is zero).. can you tell me in your understanding about window function?


    please let me know if you still don't get what my prob is..
    thanks a lot sir
     
  11. BobK

    BobK

    7,642
    1,662
    Jan 5, 2010
    In a musical instrument, the relative strengths of the harmonics do vary with time, and this contributes to the unique sound of each instrument. Is that what you are trying to determine? If so, you will need a very high sample rate so that you can use a small time window. If I recall correctly, a plucked string, like the guitar would have relatively strong harmonic content at the start, and decrease over time, whereas in something like a woodwind, the fundamental comes on strong at first and the harmonics build in strength.

    Bob
     
  12. Merlin3189

    Merlin3189

    250
    69
    Aug 4, 2011
    To be honest, I would struggle to explain the detailed maths of Fourier transforms. I can only give you my qualitative understanding of window functions.
    If you have a single pure tone sampled from -∞ to +∞, the theoretical Fourier transform of this would be a single spike representing that frequency. But of course you can’t sample from -∞ to +∞ and when you sample over a shorter period, you are effectively modulating the original signal with a pulse whose duration is the sample period.
    The simplest sample is to look at none of the signal outside the sample period (a bit obvious!) and all of the signal inside the sample period (maybe obvious, but not necessarily!) This is a rectangular window. It multiplies the signal by 0 outside the sample and multiplies it by 1 inside the sample.
    Now a rectangular pulse has its own spectrum and FT. Think of it as half a cycle of a square wave, which you probably know has an infinite series of decreasing odd harmonics. So when we sample the signal with a rectangular window, we are modulating it with another signal containing an infinite number of other frequencies. The resulting FT is no longer a single spike, but an infinite series of spikes: the original single spike is still present, though reduced in amplitude, but others, of smaller and decreasing size, have appeared. If your original signal is not a pure tone, many frequencies are present and each of them gets modulated by this rectangular pulse and all its harmonics.
    The result is to add a lot of mush to the ideal spectrum in the FT. Sharp spikes get broader, spurious peaks appear and the true peaks tend to get reduced in amplitude. It gets harder to distinguish weak signal components from spurii and to see the true amplitudes of the signal components.
    Mathematicians much cleverer than me (very, very much!) have found pulses of different shapes to use as window functions, so that these effects are controlled in some ways and give better results with particular types of signal.
    You could think for example, a square pulse with infinitely steep sides, obviously contains lots of harmonics, so perhaps we could use a sampling pulse with more rounded sides, which we would expect to have fewer harmonics. How about half a sine wave – the sides are steep, but not vertical - or a raised cosine, which starts horizontally from the negative peak and finishes similarly. Perhaps these would introduce mainly one new frequency and have fewer or weaker harmonics?
    They would sample the signal like having a volume control, which started from 0, was gradually turned up to full volume, then gradually reduced down to zero again, rather than the rectangular sample which is like switching the signal on and off at the beginning and end of the sample period.
    If that all sounds a bit vague, it is, because a lot of the maths is beyond my present capability. But I find that it satisfies my need to understand why I’m using window functions and I’m happy to take the exact details on trust.

    If you want more detail and some diagrams of window functions and their effects, I think the Wikipedia entry for "window function" shows many window functions and their spectra.
     
    Last edited: Oct 6, 2012
  13. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    yes sir this is what im looking for. and a time of it to exist in the signal
    i recorded the signal using 48KHz.. it is enough?
    yes.. totally agree.. i been using spectrum analyzer called SPAN and it allowed me to see the frequencies arise.. i notice that when signal played, some frequencies rise simultaneously with fundamental frequency? can i just assume that for guitar and piano, most of frequencies start at the same time? i know that it is not appropriate in real signal analysis, but my priority is to get a period of each frequencies for my equations.

    if i can, 'tau' in my first equation is time interval (time it fade out minus time it start which is zero) of each frequencies. What is your opinion about this sir?

    thanks a lot. if my reply is confusing, please let me know..
     
  14. asifadio

    asifadio

    8
    0
    Oct 4, 2012
    first of all, i would like to thanks to you sir.. it must take a effort to write in relatively detail explanation.. thanks a lot Mr Merlin
    now i know why rectangular window duration is 1/f..
    this is when thing get interesting.. i never think about the window function is actually act as a signal itself.. and it was use to modulate our analyzed signal.. am i correct?
    first what i understand from this is, instead of transform the signal using standard FT, we transform it under a 'condition' which is set by our windows..
    second thing that i understand is, our signal (the one that containing infinite number of frequencies) has been modulated by our window.. this is done by convolution of our square wave and our window.. this is why i get STFT equation which is window function convolve with analyzed signal.. am i correct?


    is this what you mean? http://en.wikipedia.org/wiki/Raised-cosine_filter
    i think it could be both but i more favor in it will introduce one or more new frequencies.
    anyway, i understand your explanation

    i read a book about using STFT to analyse audio signal.. it uses exactly the same equation like i show before (STFT equation).. for the windows (represented in frequency domain which mean it already transform), he use rectangular window that has interval of -fa to fa (fa is fundamental frequency).. as we expect, it just a square pulse..

    so can i say that he wants to modulate the analyze signal with rectangular pulse which is base on fundamental frequency because the fundamental frequency is the lowest frequency he can get thus longer period per oscillation..
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-