Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Phase shift in the frequency domain - Problems!!

Subject: Phase shift in the frequency domain - Problems!!

From: robert bristow-johnson

Date: 3 Sep, 2012 18:33:39

Message: 1 of 2

On 9/3/12 7:11 AM, Robert Adams wrote:
> If you examine your fft output you will find that there are 2 bins that are non zero, bin 3 and bin 255 (assuming the bins run from 1 to 256).

Bob, do you see what this MATLAB convention has done to us? now *we*
are using it, but because we know it's wrong, we also have to add a
note, a caveat or qualification so that people know for sure what we are
talking about. either that or risk being misunderstood by 1.

such a shame.

gee thanks, Cleve.

--

r b-j rbj@audioimagination.com

"Imagination is more important than knowledge."

Subject: Phase shift in the frequency domain - Problems!!

From: robert bristow-johnson

Date: 4 Sep, 2012 00:57:07

Message: 2 of 2

On 9/3/12 7:48 PM, Robert Adams wrote:
> I agree the numbering system is bad. I guess it was decided a long time ago and then no one had the courage to break all the existing scripts out there.
>

long ago (sometime in the 90s, when MATLAB was less than a decade old) i
showed Cleve exactly how to do it and be perfectly backward compatible.
  we posted it here on comp.dsp and on comp.soft-sys.matlab and there
was a lot of discussion. i think Eric Jacobson might remember, but i
cannot remember who else was around back then who are still around now.
  maybe Jerry Avins.

anyway, inside each MATLAB variable (which is an N-dimensional array),
there exists now a vector of length N that defines the length of each
dimension in the array. the total number of elements in the MATLAB
variable is the product of all of the elements of this vector. you can
get the values of this vector with the size() function and change the
values of this vector with the reshape() function (as long as the
product is the same) without touching the elements themselves.

what i proposed was another vector of the same size that defines the
index of the very first element of each dimension in the array. the
default values when a MATLAB variable is created are always equal to 1.
  THAT MAKES IT PERFECTLY BACKWARD COMPATIBLE. so no existing scripts
are broken. then, to make use of this would be two new functions that i
would call "origin()" and "reorigin()" or "base()" and "rebase()". the
first would be like size() and tell you what the origins are for each
dimension and the latter would be like reshape() and allows you to
modify the origins away from their value which has default of 1.

of course some existing math functions would be rewritten to make it
useful to any arrays of modified origin. to add or subtract arrays, not
only must the size() be the same, also the origin() would have to match
or a run-time error occurs. to multiply arrays there would have to be
an index match where the column index of one multiplicand array must
match the row index of the other.

doesn't require any courage at all. just a little bit of corporate will
at the highest level (like Cleve) and a measure of good sense.



--

r b-j rbj@audioimagination.com

"Imagination is more important than knowledge."

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us