Sampling of timelimited signals, Request for help 
Sampling of timelimited signals, Request for help 
Sep 13 2013, 19:07
Post
#1


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
I have been trying using considerable persistence and somewhat limited mathematics to grasp some aspects of sampling over the last couple of years. I have tried using a number of textbooks including Pohlamnn and Watkinsons books on Digital audio, Jim lesurf's Information and Measurement and most recently Oppenheim & Wislky's Signals and Systems (as well as AO's rather good MIT lectures from the internet and a rather good series of lecture slides from Imperial College)
I think I have just about got my mind round the idea that the Fourier transform of an impulse train in the time domain at time intervals of T is an impulse train in the frequency domain at intervals =2 pi/T illustrated in slide 10 of this http://www.ee.ic.ac.uk/pcheung/teaching/ee...20Transform.pdf and that sampling an arbitrary signal is equivalent to convolving its spectrum with the spectrum of the impulse train which will yield a spectrum identical with that of the arbtirary signal but repeated at an interval equal to the sampling frequency http://www.ee.ic.ac.uk/pcheung/teaching/ee...e%20signals.pdf slide 5 so that provided that the spectrum of the arbitrary signal is band limited to less than half the sample rate, the repeated spectra of the sampled arbitrary signal will not overlap such that the orginal spectrum can be isolated by a rectangular function in the frequency domain/sinc function in the time domain. (ibid slides 6, 16) So far so good. Where my brain freezes, and i have not really found anything really to help, is with the fact that all realworld sampling is of finite duration (whether or not the thing we wish to sample is). I (sort of) get that any time limited signal cannot be band limited but I have a more basic confusion about what the spectrum of a time limited signal is. Shannon say (rather blithely it seems to me) that a time limited signal should be regarded as being represented by a signal which has non zero values in a particular interval and zero values outside the interval and that the sample train can be regarded therefore be regarded as being non zero in that interval and zero outside that interval. Does this somehow solve the problem that we have only sampled for a limited time. I find this hugely confusing. Clearly we simply don't know what the signal is outside the period during which we sampled, it could be a period within a song, or there could have been silence before or since. Jim Lesurf considers the sampling theorem by positing that the arbitrary signal was a repeating signal on the interval in which he sampled, so that it could be represented by a Fourier series. The spectrum of that fourier series is a set of discrete impulses at an interval equal to the reciprocal of the duration of the time limited signal/sampling interval. If the signal is band limited then there only a finite number of these frequencies . I think Jim lesurf's point is that this shows that the spectrum of a band limited signal contains only a finite number of pieces of information coincides with the number of samples. (band limited and time limited ....hmmm) http://www.standrews.ac.uk/~www_pa/Scots_...f/chapter07.pdf p. 57 Either way the repeating signa which Jim lesurf posits (same sample values outside time limit) is different from the time limited signal which Shannon posits (zero outside time limit). One is a continuous spectrum and the other is a series of discrete frequencies. This takes me back to the question what is the frequency spectrum of a signal about which we only know anything during a particular window of time ? Is the answer that it is radically uncertain ie it simply cannot be said whether it is Jim lesurf's series of discrete frequencies or whether it is a continuous spectrum? I tried along the way to see if one could analyse this out instead by trying to work out the spectrum of a series of impulses which did not continue for an infinite time. I know that the spectrum of a single impulse is a complete spectrum. But what is the fourier transform of two impulses. In other words I was trying to approach this by using the same approach used to look at the sampling theorem, but this time using a finite series of impulses to see the result that has when convolved with an arbitrary spectrum. Can anyone help with my question about the Fourier transform of a finite series of impulses and/or with the wider question of how we prove that the time limited signal is perfectly recorded by an reconstitutable from a finite number of samples. Be gentle I really am trying hard. 


Sep 13 2013, 19:35
Post
#2


Group: Members Posts: 5327 Joined: 2September 02 Member No.: 3264 
This takes me back to the question what is the frequency spectrum of a signal about which we only know anything during a particular window of time ? The spectrum of a signal simply whatever the Fourier transform says it is (assuming the transform exists of course). If you want to compute it for a particular signal, evaluate the Fourier transform and see what the answer is. Edit: So far so good. Where my brain freezes, and i have not really found anything really to help, is with the fact that all realworld sampling is of finite duration (whether or not the thing we wish to sample is). I (sort of) get that any time limited signal cannot be band limited but I have a more basic confusion about what the spectrum of a time limited signal is. Evaluate the integral, and you get the transform. I think though what you really want to know is what happens if you take well known infinite functions (e.g. sin(x)) and transform them over a finite window. In this case the window (say rect(x)) is multiplies by the function in the time domain, which means they're convolved in the frequency domain. The result is that your delta function becomes a sinc function with width determined by the length of the window over which you sampled. This post has been edited by saratoga: Sep 13 2013, 19:44 


Sep 13 2013, 22:28
Post
#3


Group: Members Posts: 208 Joined: 31July 08 Member No.: 56508 
Where my brain freezes, and i have not really found anything really to help, is with the fact that all realworld sampling is of finite duration (whether or not the thing we wish to sample is). I (sort of) get that any time limited signal cannot be band limited but I have a more basic confusion about what the spectrum of a time limited signal is. The word “spectrum” may have different meanings depending on a context. For example, when speaking of continuous signals of infinite duration, or about a Nyquist theorem, “spectrum” usually means a Fourier integral. You are right: if the signal has finite duration, its spectrum is infinite. Such signals do not satisfy the bandlimited condition of a Nyquist theorem and cannot be precisely reconstructed from their digital representation. However it is important to understand that the margins of this error can be made arbitrarily small using sufficient antialiasing and reconstruction filters. Can anyone help with my question about the Fourier transform of a finite series of impulses and/or with the wider question of how we prove that the time limited signal is perfectly recorded by an reconstitutable from a finite number of samples. In practice, A/D conversion always happens on finiteduration signals that are not strictly bandlimited. Prior to ADC, such signals are approximately bandlimited using an antialiasing filter. Since noise is always present and realworld filters do not have infinitely deep stopband attenuation, some aliasing happens during A/D conversion, since Nyquist theorem is not fully satisfied. Careful design of filter+ADC keeps this aliasing within strict limits. In practice, the impulse response of filters in ADC and DAC lasts a few milliseconds. So, there's no difference between sampling an infinitely long signal that is nonzero only on a finite interval and a signal whose support is limited to that interval. Filtering slightly extends this time interval (by a few ms), but, other than that, the results of a finitelength operation of A/D and D/A converters are identical with results of an infinitely long operation. 


Sep 14 2013, 01:24
Post
#4


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
Evaluate the integral, and you get the transform. I think though what you really want to know is what happens if you take well known infinite functions (e.g. sin(x)) and transform them over a finite window. In this case the window (say rect(x)) is multiplies by the function in the time domain, which means they're convolved in the frequency domain. The result is that your delta function becomes a sinc function with width determined by the length of the window over which you sampled. Thanks for your help. Just to clarify are you taking a windowed signal in the time domain transforming that into the frequency domain and then convolving that with the spectrum of an infinite sample train? Or are we windowing the sample train first. Are you saying that a time limited sample train has a spectrum equal to a sinc function, or that the spectrum of each sample is equal to a sinc function. I think I understand that a single pulse in the time domain (not at t=0) has a spectrum which is a complex exponential. Preambly a finite series of such pulses will have a spectrum equal to the sum of such exponentials. Sorry if I am being thick, but I am struggling to see the result ie what the spectrum of the sequence of impulses will look like (although we know what it tends towards as the series becomes infinite.) 


Sep 14 2013, 01:53
Post
#5


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
In practice, A/D conversion always happens on finiteduration signals that are not strictly bandlimited. Prior to ADC, such signals are approximately bandlimited using an antialiasing filter. Since noise is always present and realworld filters do not have infinitely deep stopband attenuation, some aliasing happens during A/D conversion, since Nyquist theorem is not fully satisfied. Careful design of filter+ADC keeps this aliasing within strict limits. In practice, the impulse response of filters in ADC and DAC lasts a few milliseconds. So, there's no difference between sampling an infinitely long signal that is nonzero only on a finite interval and a signal whose support is limited to that interval. Filtering slightly extends this time interval (by a few ms), but, other than that, the results of a finitelength operation of A/D and D/A converters are identical with results of an infinitely long operation. Thanks Part of my problem is that I can get my mind round a periodic signal being analyised into frequency components but i struggle to grasp how something composed of frequency components whivh individually correspond with continous sinusoids can manage to be zero outside an interval (orthogonality?). I accept that my struggles with the correct interpretation of limited time sampling are pretty academic since in practice the reconstruction filter is only considers a few (100s?) of sample values out of the millions in the file so it, rather than the length of sampling, is what limits the accuracy of the reconstruction. 


Sep 14 2013, 02:24
Post
#6


Group: Members Posts: 1418 Joined: 9January 05 From: In the kitchen Member No.: 18957 
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on printondemand.
 
J. D. (jj) Johnston 


Sep 14 2013, 03:20
Post
#7


Group: Members Posts: 208 Joined: 31July 08 Member No.: 56508 
Part of my problem is that I can get my mind round a periodic signal being analyised into frequency components but i struggle to grasp how something composed of frequency components which individually correspond with continuous sinusoids can manage to be zero outside an interval (orthogonality?). They cannot! If the spectrum of sinusoids is finite, their sum (i.e. the timedomain signal) cannot be strictly zero outside of an interval. However it can have infinitely decaying oscillations outside of an interval. The more sinusoids you use, the closer the signal gets to zero outside of an interval. But it never reaches an exact zero — only in the limit. This is true for both periodic and nonperiodic case. I accept that my struggles with the correct interpretation of limited time sampling are pretty academic since in practice the reconstruction filter is only considers a few (100s?) of sample values out of the millions in the file Usually about 100 samples. This post has been edited by Alexey Lukin: Sep 14 2013, 03:22 


Sep 14 2013, 13:41
Post
#8


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on printondemand. Thanks. Actually I have purchased that book, conceivably on your recommendation. I am finding it helpful, although frustratingly the accompanying computer illustrations are on a floppy disk running basic in dos. I have no idea how to play it in win 7 or 8. I am still trying but for some reasons still can't get my mind round what a windowed sample train looks like in the frequency domain. Or more generally for sampling over a limited time. What heading should I be looking under (is this a dft?) 


Sep 14 2013, 14:07
Post
#9


Group: Members Posts: 1811 Joined: 24June 02 From: Catalunya(Spain) Member No.: 2383 
Use dosbox for the application. (you will probably need to change settings to access the floppy drive, or copy them to some folder accessible from dosbox). Also, i hope you know the basics of changing drive/directory and executing a program.



Sep 15 2013, 05:19
Post
#10


Group: Members Posts: 208 Joined: 31July 08 Member No.: 56508 
I am still trying but for some reasons still can't get my mind round what a windowed sample train looks like in the frequency domain. Or more generally for sampling over a limited time. The spectrum of a sample train is a sample train. If you window the timedomain sample train, its spectrum gets convolved with the spectrum of a window function. For example, if you window the sample train with a Gaissuan, each “peak” (delta function) in its spectrum becomes a Gaussian too. If you window with a rectangular window (i.e. just limit the time interval), each spectral peak becomes a sinc function (and they all add together). 


Sep 15 2013, 20:54
Post
#11


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
Use dosbox for the application. (you will probably need to change settings to access the floppy drive, or copy them to some folder accessible from dosbox). Also, i hope you know the basics of changing drive/directory and executing a program. Thanks I'll give that a go. I hope I can remember how to work dos. 


Sep 15 2013, 21:22
Post
#12


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
I am still trying but for some reasons still can't get my mind round what a windowed sample train looks like in the frequency domain. Or more generally for sampling over a limited time. The spectrum of a sample train is a sample train. If you window the timedomain sample train, its spectrum gets convolved with the spectrum of a window function. For example, if you window the sample train with a Gaissuan, each “peak” (delta function) in its spectrum becomes a Gaussian too. If you window with a rectangular window (i.e. just limit the time interval), each spectral peak becomes a sinc function (and they all add together). Thanks that's very helpful. Presumably if the window is wide the sinc function is compressed so that the sinc/Gaussian is almost indistinguishable from a delta, but if the window is narrow the departure from delta becomes significant and hence the spectrum of the sampled signal is no longer the same as the spectrum of the original signal 


Sep 16 2013, 03:37
Post
#13


Group: Members Posts: 1418 Joined: 9January 05 From: In the kitchen Member No.: 18957 
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on printondemand. Thanks. Actually I have purchased that book, conceivably on your recommendation. I am finding it helpful, although frustratingly the accompanying computer illustrations are on a floppy disk running basic in dos. I have no idea how to play it in win 7 or 8. I am still trying but for some reasons still can't get my mind round what a windowed sample train looks like in the frequency domain. Or more generally for sampling over a limited time. What heading should I be looking under (is this a dft?) Load octave and the signal package from sourceforge. The floppies with the Morrison book should be used for skeet. Then do this in octave:  x=1; for ii=10:2:20 clear x; len=2^ii; x(1:len)=0; x(100:10:1000)=1; jj=round( (ii8)/2)); subplot(6,1,jj); plot(abs(fft(x))); done  Give it a try.  
J. D. (jj) Johnston 


Sep 16 2013, 08:14
Post
#14


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
Load octave and the signal package from sourceforge. The floppies with the Morrison book should be used for skeet. Then do this in octave:  x=1; for ii=10:2:20 clear x; len=2^ii; x(1:len)=0; x(100:10:1000)=1; jj=round( (ii8)/2)); subplot(6,1,jj); plot(abs(fft(x))); done  Give it a try. I really appreciate your help. I will try to get this working and will report back. This post has been edited by adamdea: Sep 16 2013, 08:15 


Sep 16 2013, 18:51
Post
#15


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
I hate to say this JJ but i am struggling with Octave.
I have tried entering the code you posted in the command window and I am not getting any response. Is there a way of enterign this as a named program or routine so that I can check this is correct and then run. I have not found the octave manual easy to follow. 


Sep 16 2013, 19:23
Post
#16


Group: Members Posts: 5327 Joined: 2September 02 Member No.: 3264 
There's an extra parenthesis in the round call and I believe that the "done" needs to be "end". Never used octave though so I could be wrong.



Sep 17 2013, 12:49
Post
#17


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
There's an extra parenthesis in the round call and I believe that the "done" needs to be "end". Never used octave though so I could be wrong. Thanks you're right about the brackets (I think it needs one more open bracket at the beginning.) It still won't run. Any Octave users able to help with this? This post has been edited by adamdea: Sep 17 2013, 12:49 


Sep 17 2013, 19:34
Post
#18


Group: Members Posts: 5327 Joined: 2September 02 Member No.: 3264 
What happened when you tried changing the done statement?



Sep 17 2013, 21:04
Post
#19


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
What happened when you tried changing the done statement? It just did nothing I think ie there were no visible signs of anything happening. I'm such a newb that I end up having to type it all back in each time. I can't seem to save the program, load it and edit it. It is quite dispiriting. 


Sep 17 2013, 21:13
Post
#20


Group: Members Posts: 5327 Joined: 2September 02 Member No.: 3264 
I recommend copy and paste into the prompt to reduce the chance that you have mistyped something. Since octave is an interactive programming language, a lack of output probably means its waiting for you to finish entering a statement.



Sep 18 2013, 14:56
Post
#21


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
I recommend copy and paste into the prompt to reduce the chance that you have mistyped something. Since octave is an interactive programming language, a lack of output probably means its waiting for you to finish entering a statement. I now realise that it is possible to paste into octave (using button at the top left). I have tried JJ's original which crashes octave. Also the following, either with the last line as done or end either of which causes octave to do nothing obvious. x=1; for ii=10:2:20 clear x; len=2^ii; x(1:len)=0; x(100:10:1000)=1; jj=round (((ii8)/2)); subplot(6,1,jj); plot(abs(fft(x))); end This post has been edited by adamdea: Sep 18 2013, 15:28 


Sep 18 2013, 16:46
Post
#22


ReplayGain developer Group: Developer Posts: 5485 Joined: 5November 01 From: Yorkshire, UK Member No.: 409 



Sep 18 2013, 17:03
Post
#23


Group: Members (Donating) Posts: 304 Joined: 18April 02 From: Russia Member No.: 1812 
x=1; for ii=10:2:20 clear x; len=2^ii; x(1:len)=0; x(100:10:1000)=1; jj=round (((ii8)/2)); subplot(6,1,jj); plot(abs(fft(x))); end When you copypaste, did you include (selected with the mouse or whatever) the invisible "carriage return/line feed" symbol after the last word "end"? If the keyword "end" is not followed by the CR/LF, the program might think the command line is not completed and is awaiting further input. In any case, try pressing ENTER key after copypaste. This post has been edited by kdo: Sep 18 2013, 17:05 


Sep 19 2013, 16:58
Post
#24


Group: Members Posts: 35 Joined: 31August 11 Member No.: 93396 
When you copypaste, did you include (selected with the mouse or whatever) the invisible "carriage return/line feed" symbol after the last word "end"? If the keyword "end" is not followed by the CR/LF, the program might think the command line is not completed and is awaiting further input. In any case, try pressing ENTER key after copypaste. Good thinking but I'm afraid that pressing return just moves the cursor down one line. I have decided to invest in a noncommercial use Mathlab licence. (apparently about $100). 


Sep 19 2013, 17:22
Post
#25


Group: Members Posts: 109 Joined: 17October 09 Member No.: 74078 
It works in Octave here (after the corrections noted above).
Perhaps there is an issue with your Octave installation? What do have installed and what is your OS? 


LoFi Version  Time is now: 30th March 2015  08:10 