Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Sampling of time-limited signals (Read 23283 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sampling of time-limited signals

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 real-world 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.st-andrews.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.


Sampling of time-limited signals

Reply #1
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 real-world 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.

Sampling of time-limited signals

Reply #2
Where my brain freezes, and i have not really found anything really to help, is with the fact that all real-world 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 finite-duration signals that are not strictly bandlimited. Prior to ADC, such signals are approximately bandlimited using an antialiasing filter. Since noise is always present and real-world 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 finite-length operation of A/D and D/A converters are identical with results of an infinitely long operation.

Sampling of time-limited signals

Reply #3
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.)



Sampling of time-limited signals

Reply #4
In practice, A/D conversion always happens on finite-duration signals that are not strictly bandlimited. Prior to ADC, such signals are approximately bandlimited using an antialiasing filter. Since noise is always present and real-world 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 finite-length 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.

Sampling of time-limited signals

Reply #5
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on print-on-demand.
-----
J. D. (jj) Johnston

Sampling of time-limited signals

Reply #6
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 time-domain 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.

Sampling of time-limited signals

Reply #7
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on print-on-demand.

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?)

Sampling of time-limited signals

Reply #8
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.

Sampling of time-limited signals

Reply #9
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 time-domain 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).

Sampling of time-limited signals

Reply #10

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.

Sampling of time-limited signals

Reply #11
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 time-domain 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



Sampling of time-limited signals

Reply #12
For additional help: Norman Morrison's "Fourier Analysis" (I think that's the title) by Wiley Interscience. I believe it's on print-on-demand.

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( (ii-8)/2));
subplot(6,1,jj);
plot(abs(fft(x)));
done

----
Give it a try.
-----
J. D. (jj) Johnston

Sampling of time-limited signals

Reply #13
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( (ii-8)/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.

Sampling of time-limited signals

Reply #14
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.

Sampling of time-limited signals

Reply #15
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.

Sampling of time-limited signals

Reply #16
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?

Sampling of time-limited signals

Reply #17
What happened when you tried changing the done statement?

Sampling of time-limited signals

Reply #18
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.

Sampling of time-limited signals

Reply #19
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.

Sampling of time-limited signals

Reply #20
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 (((ii-8)/2));
subplot(6,1,jj);
plot(abs(fft(x)));
end

Sampling of time-limited signals

Reply #21
MATLAB does this...

[attachment=7642:matlabpic.gif]

It takes quite a few seconds to do it. Maybe Octave is busy, rather than waiting? I assume a basic...

figure
plot(1:10)

...plots something on your system?

Cheers,
David.

Sampling of time-limited signals

Reply #22
x=1;
for ii=10:2:20
clear x;
len=2^ii;
x(1:len)=0;
x(100:10:1000)=1;
jj=round (((ii-8)/2));
subplot(6,1,jj);
plot(abs(fft(x)));
end

When you copy-paste, 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 copy-paste.

Sampling of time-limited signals

Reply #23
When you copy-paste, 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 copy-paste.

Good thinking but I'm afraid that pressing return just moves the cursor down one line.

I have decided to invest in a non-commercial use Mathlab licence. (apparently about $100).

Sampling of time-limited signals

Reply #24
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?