Discrete Chebyshev transform

In applied mathematics, the discrete Chebyshev transform (DCT), named after Pafnuty Chebyshev, is either of two main varieties of DCTs: the discrete Chebyshev transform on the 'roots' grid of the Chebyshev polynomials of the first kind and the discrete Chebyshev transform on the 'extrema' grid of the Chebyshev polynomials of the first kind.

Discrete Chebyshev transform on the roots grid

The discrete chebyshev transform of u(x) at the points is given by:

where:

where and otherwise.

Using the definition of ,

and its inverse transform:

(This so happens to the standard Chebyshev series evaluated on the roots grid.)

This can readily be obtained by manipulating the input arguments to a discrete cosine transform.

This can be demonstrated using the following MATLAB code:

function a=fct(f,l)
%x=-cos(pi/N*((0:N-1)'+1/2));

f=f(end:-1:1,:);
A=size(f); N=A(1); 
if exist('A(3)','var') && A(3)~=1
    for i=1:A(3)
        
        a(:,:,i)=sqrt(2/N)*dct(f(:,:,i));
        a(1,:,i)=a(1,:,i)/sqrt(2);
      
    end
else

   a=sqrt(2/N)*dct(f(:,:,i));
   a(1,:)=a(1,:)/sqrt(2);

end

The discrete cosine transform (dct) is in fact computed using a fast Fourier transform algorithm in MATLAB.
And the inverse transform is given by the MATLAB code:

function f=ifct(a,l)
%x=-cos(pi/N*((0:N-1)'+1/2)) 
k=size(a); N=k(1);

a=idct(sqrt(N/2)*[a(1,:)*sqrt(2); a(2:end,:)]);

end

Discrete Chebyshev transform on the extrema grid

This transform uses the grid:

This transform is more difficult to implement by use of a Fast Fourier Transform (FFT). However it is more widely used because it is on the extrema grid which tends to be most useful for boundary value problems. Mostly because it is easier to apply boundary conditions on this grid.

There is a discrete (and in fact fast because it performs the dct by using a fast Fourier transform) available at the MATLAB file exchange that was created by Greg von Winckel. So it is omitted here.

In this case the transform and its inverse are

where and otherwise.

Usage and implementations

The primary uses of the discrete Chebyshev transform are numerical integration, interpolation, and stable numerical differentiation[1]. An implementation which provides these features is given in the C++ library Boost[2]

gollark: Yes; it's *very hard* to go around editing the FS API such that other stuff isn't affected.
gollark: ```pythonfrom requests_futures.sessions import FuturesSessionimport concurrent.futures as futuresimport randomtry: import cPickle as pickleexcept ImportError: import pickletry: words_to_synonyms = pickle.load(open(".wtscache")) synonyms_to_words = pickle.load(open(".stwcache"))except: words_to_synonyms = {} synonyms_to_words = {}def add_to_key(d, k, v): d[k] = d.get(k, set()).union(set(v))def add_synonyms(syns, word): for syn in syns: add_to_key(synonyms_to_words, syn, [word]) add_to_key(words_to_synonyms, word, syns)def concat(list_of_lists): return sum(list_of_lists, [])def add_words(words): s = FuturesSession(max_workers=100) future_to_word = {s.get("https://api.datamuse.com/words", params={"ml": word}): word for word in words} future_to_word.update({s.get("https://api.datamuse.com/words", params={"ml": word, "v": "enwiki"}): word for word in words}) for future in futures.as_completed(future_to_word): word = future_to_word[future] try: data = future.result().json() except Exception as exc: print(f"{exc} fetching {word}") else: add_synonyms([w["word"] for w in data], word)def getattr_hook(obj, key): results = list(synonyms_to_words.get(key, set()).union(words_to_synonyms.get(key, set()))) if len(results) > 0: return obj.__getattribute__(random.choice(results)) else: raise AttributeError(f"Attribute {key} not found.")def wrap(obj): add_words(dir(obj)) obj.__getattr__ = lambda key: getattr_hook(obj, key)wrap(__builtins__)raise __builtins__.quibble()```
gollark: table.deepcopy, table.shallowcopy, table.slice, table.filter, table.map
gollark: Same with many other utility thingies.
gollark: Not really. They could have table.copy but they don't.

See also

References

  1. Trefethen, Lloyd (2013). Approximation Theory and Approximation Practice.
  2. Thompson, Nick; Maddock, John. "Chebyshev Polynomials". boost.org.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.