DSPRelated.com
Forums

Question about DSP in Matlab (beginner)

Started by JCO_DSP May 23, 2015
[...snip...]

>>As long as the frequencies are below the Nyquist limit, you do not get >>any better frequency resolution, meaning being able to discern >(resolve) >two >>different tones, by increasing the number of samples. >> > >On this one, I have been scratching me head since last night. >Doesn't everybody say fft frequency resolution = Fs/N (= bin width)??? >Or >is your concept of resolution something else? > >That is what I meant by accuracy, may be not best wording but should be >ok >for a practical DSP beginner. > > >Kaz > > >--------------------------------------- >Posted through http://www.DSPRelated.com
I am more of a Mathematician and a Scientist than an Engineer, so I apologize if my terminology isn't what you are used to. This is why I tried to explain what I meant with examples. There are three words that are often used synonymously which actually have distinct technical meanings. They are "resolution", "accuracy", and "precision". I use resolution from its root meaning being "to resolve", as in this sentence I found on the net: "The resolution of an optical microscope is defined as the shortest distance between two points on a specimen that can still be distinguished as separate entities." If I have a thermometer that can measure to the nearest thousandth of a degree, but is off by five degrees (miscalibrated), it is precise, but not accurate. If I have a thermometer that reads the correct temperature, but I can only measure to the nearest degree, it is accurate, but not precise. I was using the term "accuracy" in the vernacular to mean both accurate and precise. In mathematics, "exact" means accurate with infinite precision. In engineering, "exact" means matching in value to the limit of the measurement resolution. When I say my frequency formula is exact, I mean in the mathematical way. In the time domain, "sampling density" and "sampling rate" mean the same thing. Fourier series are not limited to only time series data. Let me explain why increasing the number of samples within an interval does not increase the frequency precision. Suppose you have a 60 +/- 3 Hz clean pure signal measured in a tenth of a second time frame at the CD quality rate of 44100 samples per second. Now starting at time zero, you take your first sample, then take nine more every hundredth of second (441) samples. You do a ten sample DFT and calculate the frequency and get an exact answer. Instead, if you use every sample point, and do a 44100 bin DFT, and calculate the frequency, you will still get an exact answer. The two answers will be the same, no improvement. In both DFTs, the peak value will be at bin six. One final thing, just because everybody says so, doesn't necessarily make it true. Hope this helps. Ced --------------------------------------- Posted through http://www.DSPRelated.com

>Let me explain why increasing the number of samples within an interval >does not increase the frequency precision. Suppose you have a 60 +/- 3 >Hz
Small oops. That would be an alias frequency in my example. Suppose the signal is 30 +/- 3 Hz. Ced --------------------------------------- Posted through http://www.DSPRelated.com
On Sat, 23 May 2015 12:10:22 -0500, JCO_DSP wrote:

> Hi, > > I'm starting to learn DSP (Matlab )
If you are equating knowing Matlab with knowing DSP, then your error is insurmountable until you understand that DSP is a thing you do, mathematics is the tool you use to understand it, and Matlab is a tool you use, _after_ you understand the math, to do the math. -- www.wescottdesign.com
>On Sat, 23 May 2015 12:10:22 -0500, JCO_DSP wrote: > >> Hi, >> >> I'm starting to learn DSP (Matlab ) > >If you are equating knowing Matlab with knowing DSP, then your error is > >insurmountable until you understand that DSP is a thing you do, >mathematics is the tool you use to understand it, and Matlab is a tool >you use, _after_ you understand the math, to do the math. > >-- >www.wescottdesign.com
Tim, I completely disgree with you. What you are saying is originally from that guy 'Vlad' who has vanished. DSP is the product of programming and observing patterns of data then coming out with some statements and plots. Without programming our little brains can hardly have got anywhere. Matlab or any such tools are very intuitive, far more than any books or fora clutter and impulsive partial replies. It looks like we get dsp insight using tools then claim we know it by heart and don't want others to learn the way we did. Matlab is designed by many experts in their fields, refined and tested over years. DSP is the product of tools refined or messed up by human statements. Kaz --------------------------------------- Posted through http://www.DSPRelated.com
>>On Sat, 23 May 2015 12:10:22 -0500, JCO_DSP wrote: >> >>> Hi, >>> >>> I'm starting to learn DSP (Matlab ) >> >>If you are equating knowing Matlab with knowing DSP, then your error >is >> >>insurmountable until you understand that DSP is a thing you do, >>mathematics is the tool you use to understand it, and Matlab is a tool > >>you use, _after_ you understand the math, to do the math. >> >>-- >>www.wescottdesign.com > >Tim, I completely disgree with you. What you are saying is originally >from >that guy 'Vlad' who has vanished. >DSP is the product of programming and observing patterns of data then >coming out with some statements and plots.
[...snip...]
> >Kaz >--------------------------------------- >Posted through http://www.DSPRelated.com
Tim, I have to agree with Kaz on this one. When I first read your post, I thought it was unduly harsh and discouraging. Mathematics has often been described as syntactic encapsulation of patterns. Seeing the patterns first makes it way easier to understand the mathematical statement that describes them. That is in accordance with the Scientific Method, in which the first two steps are making observations and then formulating a hypothesis. In reverse, when you are learning what a mathematical statement means, it is generally quite useful to see an example of the pattern that the statement describes to understand it better. So to the OP, keep playing around, keep asking questions, and I hope you are enjoying learning. Speaking of comp.dsp negative nellies/bullies, Rune also appears to be gone. Ced --------------------------------------- Posted through http://www.DSPRelated.com
"kaz" <37480@DSPRelated> writes:

>>On Sat, 23 May 2015 12:10:22 -0500, JCO_DSP wrote: >> >>> Hi, >>> >>> I'm starting to learn DSP (Matlab ) >> >>If you are equating knowing Matlab with knowing DSP, then your error is >> >>insurmountable until you understand that DSP is a thing you do, >>mathematics is the tool you use to understand it, and Matlab is a tool >>you use, _after_ you understand the math, to do the math. >> >>-- >>www.wescottdesign.com > > Tim, I completely disgree with you. What you are saying is originally from > that guy 'Vlad' who has vanished.
"Vlad the Impaler"
> DSP is the product of programming and observing patterns of data then > coming out with some statements and plots.
If by "DSP" you mean learning the theory of "Digital Signal Processing," then I disagree. I studied and learned most DSP without a computer. It took a pencil, paper, knowledge of the underlying mathematics and hours upon hours of study time.
> Without programming our little > brains can hardly have got anywhere. Matlab or any such tools are very > intuitive, far more than any books or fora clutter and impulsive partial > replies. It looks like we get dsp insight using tools then claim we know > it by heart and don't want others to learn the way we did. Matlab is > designed by many experts in their fields, refined and tested over years. > DSP is the product of tools refined or messed up by human statements.
Nonsense. Now I am NOT saying Matlab is useless when studying DSP. It can help. But it can't substitute for pencil and paper study. The use of Matlab in DSP follows closely the general axiom that "the computer amplifies the mind." -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
[...snip...]
> >If by "DSP" you mean learning the theory of "Digital Signal >Processing," >then I disagree. I studied and learned most DSP without a computer. It >took a pencil, paper, knowledge of the underlying mathematics and hours >upon hours of study time. >
Perhaps your hours and hours could have been cut down if you had had a computer. I'm sorry, but this statement sounds to me a little like "When I was young, we had to walk five miles to school each way, through snowdrifts, uphill both ways, and we liked it!" Assuming what worked for you is what would work best for someone else is a bit tenuous in my opinion.
>> Without programming our little >> brains can hardly have got anywhere. Matlab or any such tools are >very >> intuitive, far more than any books or fora clutter and impulsive >partial >> replies. It looks like we get dsp insight using tools then claim we >know >> it by heart and don't want others to learn the way we did. Matlab is >> designed by many experts in their fields, refined and tested over >years. >> DSP is the product of tools refined or messed up by human statements. > >Nonsense. >
I kind of agree that this part of Kaz's reply wasn't the most sensible. Of course you can learn DSP without Matlab. Whether Matlab, or something similar, is better than pen and pencil, books, or interactive tutorials is entirely subjective. It is strange to me, Kaz is saying we don't want others to learn the way we did and Randy Yates is saying that is how it should be done. My opinion is figuring stuff out yourself is how you understand it the best. Occasionally you can figure out something no one else has before. Whether this is best done with paper and pencil or with a computer, I'm not going to commit to.
>Now I am NOT saying Matlab is useless when studying DSP. It can help. >But it can't substitute for pencil and paper study. The use of Matlab >in >DSP follows closely the general axiom that "the computer amplifies the >mind." >-- >Randy Yates >Digital Signal Labs >http://www.digitalsignallabs.com
I have never used Matlab. Ced --------------------------------------- Posted through http://www.DSPRelated.com
kaz <37480@dsprelated> wrote:
>>On Sat, 23 May 2015 12:10:22 -0500, JCO_DSP wrote: >>> I'm starting to learn DSP (Matlab )
>>If you are equating knowing Matlab with knowing DSP, then your error is
>>insurmountable until you understand that DSP is a thing you do, >>mathematics is the tool you use to understand it, and Matlab is a tool >>you use, _after_ you understand the math, to do the math.
(snip)
> Tim, I completely disgree with you. What you are saying is originally from > that guy 'Vlad' who has vanished.
I think the right answer is somewhere in between. If you teach DSP using Matlab as a learning tool, it should work. But Tim is right that you do have to understand what you are doing.
> DSP is the product of programming and observing patterns of data then > coming out with some statements and plots. Without programming our little > brains can hardly have got anywhere. Matlab or any such tools are very > intuitive, far more than any books or fora clutter and impulsive partial > replies. It looks like we get dsp insight using tools then claim we know > it by heart and don't want others to learn the way we did. Matlab is > designed by many experts in their fields, refined and tested over years. > DSP is the product of tools refined or messed up by human statements.
If you understand what the tool is doing, it is a great way to learn. If you want a magic box, where you don't have to do any thinking, just put in numbers and get results, it isn't. So, for the "tool to use after you understand the math", it could be an hour or a day after you understand, but it isn't a substitute for the understanding. -- glen
"kaz" <37480@DSPRelated> writes:

> Without programming our little > brains can hardly have got anywhere. Matlab or any such tools are very > intuitive, far more than any books or fora clutter and impulsive partial > replies. It looks like we get dsp insight using tools then claim we know > it by heart and don't want others to learn the way we did. Matlab is > designed by many experts in their fields, refined and tested over years. > DSP is the product of tools refined or messed up by human statements.
This, um, ignores the decades of DSP research that preceded the introduction of MATLAB. Which, by the way, was not actually aimed at DSP in particular, it was intended for a now-forgotten category of software engineer once called a "math analyst". Steve
"Cedron" <103185@DSPRelated> writes:
> [...]
> Perhaps your hours and hours could have been cut down if you had had a > computer. I'm sorry, but this statement sounds to me a little like "When > I was young, we had to walk five miles to school each way, through > snowdrifts, uphill both ways, and we liked it!"
Yes, and most people who claim this can kick most other folks' ass when it comes to hard work (my father included).
> Assuming what worked for you is what would work best for someone else > is a bit tenuous in my opinion.
It's not "what worked for me" - it's what can't possibly work.
> [...] > Whether this is best done with paper and pencil or with a computer, I'm > not going to commit to.
"A computer is an amplifier for the mind." How many computers have submitted papers to the IEEE or made presentations at the AES conventions? I fail to understand why this concept is difficult to grasp. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com