From a88c45a329c4a40869e192d57f364f4437b32900 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Wed, 15 Aug 2018 13:00:04 +0300 Subject: [PATCH] Fix typos. --- README.md | 1 + .../math/fourier-transform/discreteFourierTransform.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d29d7b1b..edac6451 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ algorithm is an abstraction higher than a computer program. * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - trapping rain water problem * `A` [Maximum Subarray](src/algorithms/sets/maximum-subarray) * `A` [Travelling Salesman Problem](src/algorithms/graph/travelling-salesman) - shortest possible route that visits each city and returns to the origin city + * `A` [Discrete Fourier Transform](src/algorithms/math/fourier-transform) - decompose a function of time (a signal) into the frequencies that make it up * **Greedy** - choose the best option at the current time, without any consideration for the future * `B` [Jump Game](src/algorithms/uncategorized/jump-game) * `A` [Unbound Knapsack Problem](src/algorithms/sets/knapsack-problem) diff --git a/src/algorithms/math/fourier-transform/discreteFourierTransform.js b/src/algorithms/math/fourier-transform/discreteFourierTransform.js index fac5d4ca..d9213814 100644 --- a/src/algorithms/math/fourier-transform/discreteFourierTransform.js +++ b/src/algorithms/math/fourier-transform/discreteFourierTransform.js @@ -11,7 +11,7 @@ import ComplexNumber from '../complex-number/ComplexNumber'; */ export default function discreteFourierTransform(inputSignalAmplitudes) { const N = inputSignalAmplitudes.length; - const outpuFrequencies = []; + const outputFrequencies = []; // For every frequency discrete... for (let frequencyValue = 0; frequencyValue < N; frequencyValue += 1) { @@ -48,8 +48,8 @@ export default function discreteFourierTransform(inputSignalAmplitudes) { // Average contribution at this frequency signal = signal.divide(N); - outpuFrequencies[frequencyValue] = signal; + outputFrequencies[frequencyValue] = signal; } - return outpuFrequencies; + return outputFrequencies; }