Hi, I have a question regarding complex numbers in FFT. I used an ADC to convert an analogue signal to a digital signal and send it to the computer through the parallel port. It is a 8-bit ADC. When i got the data inside the computer, how do I change it into a complex number? Can anyone advise me on how to deal with this problem? Another thing is about the N-points. How do i determine the N-points of a signal? Is it N=8 because the input signal is a 8-bit signal? Please advise and guide me. Thanks
Conversion of data to complex numbers??
Started by ●January 3, 2006
Reply by ●January 3, 20062006-01-03
"ooi_yw" <yuwei_1712@hotmail.com> wrote in message news:1136309904.904078.6310@g49g2000cwa.googlegroups.com...> Hi, > > I have a question regarding complex numbers in FFT. > > I used an ADC to convert an analogue signal to a digital signal and > send it to the computer through the parallel port. It is a 8-bit ADC. > > When i got the data inside the computer, how do I change it into a > complex number? Can anyone advise me on how to deal with this problem?Hi yuwei Changing your data into a complex number depends on what kind of data you have sampled using your ADC. Based on your question, it appears that you are confused on how to perform an FFT on the sampled data. With this in mind, your data can be considered the real part of a complex number x = a + ib where a is the real part and b is the imaginary part. So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 and a(n) is your data. Most fft routines should be able to directly deal with real data as input and output a complex number in the frequency domain. But if you'd rather keep things straight forward, you can use my suggestions of setting your imaginary numbers to 0 and creating the complex values.> Another thing is about the N-points. How do i determine the N-points of > a signal? Is it N=8 because the input signal is a 8-bit signal?No, the bit width (in your case 8) has nothing to do with the length of your FFT (N). You have to decide the size/length of your FFT based on how much frequency resolution you need. The frequency resolution will be fs/N where fs is the sampling frequency of your data. There are plenty of tutorials on the web on FFTs which you can find by googling. I highly recommend that you study some of these tutorials to understand what you are doing a little better. Cheers Bhaskar
Reply by ●January 3, 20062006-01-03
"ooi_yw" <yuwei_1712@hotmail.com> wrote in message news:1136309904.904078.6310@g49g2000cwa.googlegroups.com...> Hi, > > I have a question regarding complex numbers in FFT. > > I used an ADC to convert an analogue signal to a digital signal and > send it to the computer through the parallel port. It is a 8-bit ADC. > > When i got the data inside the computer, how do I change it into a > complex number? Can anyone advise me on how to deal with this problem?Hi yuwei Changing your data into a complex number depends on what kind of data you have sampled using your ADC. Based on your question, it appears that you are confused on how to perform an FFT on the sampled data. With this in mind, your data can be considered the real part of a complex number x = a + ib where a is the real part and b is the imaginary part. So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 and a(n) is your data. Most fft routines should be able to directly deal with real data as input and output a complex number in the frequency domain. But if you'd rather keep things straight forward, you can use my suggestions of setting your imaginary numbers to 0 and creating the complex values.> Another thing is about the N-points. How do i determine the N-points of > a signal? Is it N=8 because the input signal is a 8-bit signal?No, the bit width (in your case 8) has nothing to do with the length of your FFT (N). You have to decide the size/length of your FFT based on how much frequency resolution you need. The frequency resolution will be fs/N where fs is the sampling frequency of your data. There are plenty of tutorials on the web on FFTs which you can find by googling. I highly recommend that you study some of these tutorials to understand what you are doing a little better. Cheers Bhaskar
Reply by ●January 3, 20062006-01-03
"ooi_yw" <yuwei_1712@hotmail.com> wrote in message news:1136309904.904078.6310@g49g2000cwa.googlegroups.com...> Hi, > > I have a question regarding complex numbers in FFT. > > I used an ADC to convert an analogue signal to a digital signal and > send it to the computer through the parallel port. It is a 8-bit ADC. > > When i got the data inside the computer, how do I change it into a > complex number? Can anyone advise me on how to deal with this problem?Hi yuwei Changing your data into a complex number depends on what kind of data you have sampled using your ADC. Based on your question, it appears that you are confused on how to perform an FFT on the sampled data. With this in mind, your data can be considered the real part of a complex number x = a + ib where a is the real part and b is the imaginary part. So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 and a(n) is your data. Most fft routines should be able to directly deal with real data as input and output a complex number in the frequency domain. But if you'd rather keep things straight forward, you can use my suggestions of setting your imaginary numbers to 0 and creating the complex values.> Another thing is about the N-points. How do i determine the N-points of > a signal? Is it N=8 because the input signal is a 8-bit signal?No, the bit width (in your case 8) has nothing to do with the length of your FFT (N). You have to decide the size/length of your FFT based on how much frequency resolution you need. The frequency resolution will be fs/N where fs is the sampling frequency of your data. There are plenty of tutorials on the web on FFTs which you can find by googling. I highly recommend that you study some of these tutorials to understand what you are doing a little better. Cheers Bhaskar
Reply by ●January 3, 20062006-01-03
"Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:43bab8ef$0$15791$14726298@news.sunsite.dk...> "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com..............> You have to decide the size/length of your FFT based on how much frequency > resolution you need. The frequency resolution will be fs/N where fs is the > sampling frequency of your data. >Or, similarly, the resolution may be based on how many samples you have available. As Bhaskar said, the frequency resolution will be fs/N where fs is the sampling frequency of your data and N is the number of samples that you will transform ..... So, if all you have are K samples, the time epoch spanned by those samples is K*(1/fs) and the frequency resolution will be the reciprocal of the time epoch 1/[K*(1/fs)] = fs/K. (and, of course, for the transform you compute, N=K) Fred
Reply by ●January 3, 20062006-01-03
Bhaskar Thiagarajan wrote:> "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com... > >>Hi, >> >>I have a question regarding complex numbers in FFT. >> >>I used an ADC to convert an analogue signal to a digital signal and >>send it to the computer through the parallel port. It is a 8-bit ADC. >> >>When i got the data inside the computer, how do I change it into a >>complex number? Can anyone advise me on how to deal with this problem? > > > Hi yuwei > > Changing your data into a complex number depends on what kind of data you > have sampled using your ADC. > Based on your question, it appears that you are confused on how to perform > an FFT on the sampled data. With this in mind, your data can be considered > the real part of a complex number x = a + ib where a is the real part and b > is the imaginary part. > So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 > and a(n) is your data. > > Most fft routines should be able to directly deal with real data as input > and output a complex number in the frequency domain. But if you'd rather > keep things straight forward, you can use my suggestions of setting your > imaginary numbers to 0 and creating the complex values. > > >>Another thing is about the N-points. How do i determine the N-points of >>a signal? Is it N=8 because the input signal is a 8-bit signal? > > > No, the bit width (in your case 8) has nothing to do with the length of your > FFT (N). > You have to decide the size/length of your FFT based on how much frequency > resolution you need. The frequency resolution will be fs/N where fs is the > sampling frequency of your data. > > There are plenty of tutorials on the web on FFTs which you can find by > googling. I highly recommend that you study some of these tutorials to > understand what you are doing a little better. > > Cheers > BhaskarWhat is an "imaginary signal" in a "physical reality" context? I'm of *PRAGMATIC* engineer mindset - if works then use ;) I am reasonable comfortable representing a function as k*e^(jWt+phi) rather than (a*sin(wt+omega)). But I'm sure I'm missing something in world of forward/inverse fouier transforms. Get the idea I'm not sure even on how to form the question? I'm missing something fundamental (and probably trivial). [we *WILL* ignore question of what mathematician defines as trivial;]
Reply by ●January 3, 20062006-01-03
Bhaskar Thiagarajan wrote:> "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com... > >>Hi, >> >>I have a question regarding complex numbers in FFT. >> >>I used an ADC to convert an analogue signal to a digital signal and >>send it to the computer through the parallel port. It is a 8-bit ADC. >> >>When i got the data inside the computer, how do I change it into a >>complex number? Can anyone advise me on how to deal with this problem? > > > Hi yuwei > > Changing your data into a complex number depends on what kind of data you > have sampled using your ADC. > Based on your question, it appears that you are confused on how to perform > an FFT on the sampled data. With this in mind, your data can be considered > the real part of a complex number x = a + ib where a is the real part and b > is the imaginary part. > So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 > and a(n) is your data. > > Most fft routines should be able to directly deal with real data as input > and output a complex number in the frequency domain. But if you'd rather > keep things straight forward, you can use my suggestions of setting your > imaginary numbers to 0 and creating the complex values. > > >>Another thing is about the N-points. How do i determine the N-points of >>a signal? Is it N=8 because the input signal is a 8-bit signal? > > > No, the bit width (in your case 8) has nothing to do with the length of your > FFT (N). > You have to decide the size/length of your FFT based on how much frequency > resolution you need. The frequency resolution will be fs/N where fs is the > sampling frequency of your data. > > There are plenty of tutorials on the web on FFTs which you can find by > googling. I highly recommend that you study some of these tutorials to > understand what you are doing a little better. > > Cheers > BhaskarWhat is an "imaginary signal" in a "physical reality" context? I'm of *PRAGMATIC* engineer mindset - if works then use ;) I am reasonable comfortable representing a function as k*e^(jWt+phi) rather than (a*sin(wt+omega)). But I'm sure I'm missing something in world of forward/inverse fouier transforms. Get the idea I'm not sure even on how to form the question? I'm missing something fundamental (and probably trivial). [we *WILL* ignore question of what mathematician defines as trivial;]
Reply by ●January 3, 20062006-01-03
Bhaskar Thiagarajan wrote:> "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com... > >>Hi, >> >>I have a question regarding complex numbers in FFT. >> >>I used an ADC to convert an analogue signal to a digital signal and >>send it to the computer through the parallel port. It is a 8-bit ADC. >> >>When i got the data inside the computer, how do I change it into a >>complex number? Can anyone advise me on how to deal with this problem? > > > Hi yuwei > > Changing your data into a complex number depends on what kind of data you > have sampled using your ADC. > Based on your question, it appears that you are confused on how to perform > an FFT on the sampled data. With this in mind, your data can be considered > the real part of a complex number x = a + ib where a is the real part and b > is the imaginary part. > So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 > and a(n) is your data. > > Most fft routines should be able to directly deal with real data as input > and output a complex number in the frequency domain. But if you'd rather > keep things straight forward, you can use my suggestions of setting your > imaginary numbers to 0 and creating the complex values. > > >>Another thing is about the N-points. How do i determine the N-points of >>a signal? Is it N=8 because the input signal is a 8-bit signal? > > > No, the bit width (in your case 8) has nothing to do with the length of your > FFT (N). > You have to decide the size/length of your FFT based on how much frequency > resolution you need. The frequency resolution will be fs/N where fs is the > sampling frequency of your data. > > There are plenty of tutorials on the web on FFTs which you can find by > googling. I highly recommend that you study some of these tutorials to > understand what you are doing a little better. > > Cheers > BhaskarWhat is an "imaginary signal" in a "physical reality" context? I'm of *PRAGMATIC* engineer mindset - if works then use ;) I am reasonable comfortable representing a function as k*e^(jWt+phi) rather than (a*sin(wt+omega)). But I'm sure I'm missing something in world of forward/inverse fouier transforms. Get the idea I'm not sure even on how to form the question? I'm missing something fundamental (and probably trivial). [we *WILL* ignore question of what mathematician defines as trivial;]
Reply by ●January 3, 20062006-01-03
Bhaskar Thiagarajan wrote:> "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com... > >>Hi, >> >>I have a question regarding complex numbers in FFT. >> >>I used an ADC to convert an analogue signal to a digital signal and >>send it to the computer through the parallel port. It is a 8-bit ADC. >> >>When i got the data inside the computer, how do I change it into a >>complex number? Can anyone advise me on how to deal with this problem? > > > Hi yuwei > > Changing your data into a complex number depends on what kind of data you > have sampled using your ADC. > Based on your question, it appears that you are confused on how to perform > an FFT on the sampled data. With this in mind, your data can be considered > the real part of a complex number x = a + ib where a is the real part and b > is the imaginary part. > So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 > and a(n) is your data. > > Most fft routines should be able to directly deal with real data as input > and output a complex number in the frequency domain. But if you'd rather > keep things straight forward, you can use my suggestions of setting your > imaginary numbers to 0 and creating the complex values. > > >>Another thing is about the N-points. How do i determine the N-points of >>a signal? Is it N=8 because the input signal is a 8-bit signal? > > > No, the bit width (in your case 8) has nothing to do with the length of your > FFT (N). > You have to decide the size/length of your FFT based on how much frequency > resolution you need. The frequency resolution will be fs/N where fs is the > sampling frequency of your data. > > There are plenty of tutorials on the web on FFTs which you can find by > googling. I highly recommend that you study some of these tutorials to > understand what you are doing a little better. > > Cheers > BhaskarWhat is an "imaginary signal" in a "physical reality" context? I'm of *PRAGMATIC* engineer mindset - if works then use ;) I am reasonable comfortable representing a function as k*e^(jWt+phi) rather than (a*sin(wt+omega)). But I'm sure I'm missing something in world of forward/inverse fouier transforms. Get the idea I'm not sure even on how to form the question? I'm missing something fundamental (and probably trivial). [we *WILL* ignore question of what mathematician defines as trivial;]
Reply by ●January 3, 20062006-01-03
Richard Owlett wrote:> Bhaskar Thiagarajan wrote: > > > "ooi_yw" <yuwei_1712@hotmail.com> wrote in message > > news:1136309904.904078.6310@g49g2000cwa.googlegroups.com... > > > >>Hi, > >> > >>I have a question regarding complex numbers in FFT. > >> > >>I used an ADC to convert an analogue signal to a digital signal and > >>send it to the computer through the parallel port. It is a 8-bit ADC. > >> > >>When i got the data inside the computer, how do I change it into a > >>complex number? Can anyone advise me on how to deal with this problem? > > > > > > Hi yuwei > > > > Changing your data into a complex number depends on what kind of data you > > have sampled using your ADC. > > Based on your question, it appears that you are confused on how to perform > > an FFT on the sampled data. With this in mind, your data can be considered > > the real part of a complex number x = a + ib where a is the real part and b > > is the imaginary part. > > So you can create complex numbers x(n) = a(n) + i*b(n) where all the b(n)=0 > > and a(n) is your data. > > > > Most fft routines should be able to directly deal with real data as input > > and output a complex number in the frequency domain. But if you'd rather > > keep things straight forward, you can use my suggestions of setting your > > imaginary numbers to 0 and creating the complex values. > > > > > >>Another thing is about the N-points. How do i determine the N-points of > >>a signal? Is it N=8 because the input signal is a 8-bit signal? > > > > > > No, the bit width (in your case 8) has nothing to do with the length of your > > FFT (N). > > You have to decide the size/length of your FFT based on how much frequency > > resolution you need. The frequency resolution will be fs/N where fs is the > > sampling frequency of your data. > > > > There are plenty of tutorials on the web on FFTs which you can find by > > googling. I highly recommend that you study some of these tutorials to > > understand what you are doing a little better. > > > > Cheers > > Bhaskar > > > What is an "imaginary signal" in a "physical reality" context? > > I'm of *PRAGMATIC* engineer mindset - if works then use ;) > > I am reasonable comfortable representing a function as k*e^(jWt+phi) > rather than (a*sin(wt+omega)). > > But I'm sure I'm missing something in world of forward/inverse fouier > transforms. > > Get the idea I'm not sure even on how to form the question? > I'm missing something fundamental (and probably trivial). > [we *WILL* ignore question of what mathematician defines as trivial;]The imaginary number system is, in the context of physics, convenient. It is not necessarily "true" in any sense and the imaginary part does not necessaarily "mean" anything, but it does simplify the arithmetic. To daw a parallel, the ancient Greeks and Romans lived in the same physical world as we do, the same laws of both physics and maths that are valid today were valid then. The Romans and Greeks did discover lots of stuff relevant to modern day maths and physics, but they did not invent mathematical physics. Kepler and Gallileo did that. Now, why did a society (well, two) that fostered an Archimedes, a Pythagoras, a Ptolemaios, that built tunnels through mountains and aquaducts across valleys and so on, not come close to mathemathical physics? Because they lacked the arithmetics. I don't know what number system the Greeks used, but the Roman number system is all but useless to do even the simplest arithmetics beyond trivial indexing. The fact that the same number can be written in several ways, e.g. MIM and MDCCCLXXXXIX are both representations of the same number (if I got the L=50 and D=500 right...), 1999 in our notation. Such a trivial detail makes it all but impossible to develop a useful arithmetic. So the complex numbers are useful arithmetical tools that make life a lot easier. What mathemathical physics is concerned, I believe it is best to leave the question there. Rune






