Sunday, April 21, 2019

An Interactive Introduction to Fourier Transforms

Here is a great introduction to Fourier Transforms.

The focus is on developing a intuitive understanding for the decomposition of a signal into it component waves. You can draw different signals and "listen" to the contribution of the individual frequencies.

A good complement to this resource is this video from Grant Sanderson (3Blue1Brown).

There are numerous mathematical definitions of Fourier transforms. John D. Cook put together an exhaustive list, including pointers on how to move between the different definitions.

Thursday, April 11, 2019

Reshaping NumPy Arrays into Columns

$ x = np.arange(5)
$ x
array([0, 1, 2, 3, 4])

Two different methods:

$ x.reshape(-1,1)
array([[0],
       [1],
       [2],
       [3],
       [4]])

$ np.c_[x]
array([[0],
       [1],
       [2],
       [3],
       [4]])