Skip to content

Commit

Permalink
README: update wording
Browse files Browse the repository at this point in the history
  • Loading branch information
lschneiderbauer committed Jan 5, 2025
1 parent d04bbde commit 78f3cbd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ See the original paper by Arts, L.P.A., van den Broek, E.L. The fast continuous
- [fftw](https://www.fftw.org/) library with [single-precision support](https://www.fftw.org/faq/section2.html#singleprec) enabled (used by [fCWT](https://github.com/fastlib/fCWT))
- Optional: a CPU/compiler supporting the [AVX](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) instruction set
- Optional: OpenMP (and fftw built with [OpenMP support](https://www.fftw.org/doc/Usage-of-Multi_002dthreaded-FFTW.html))
- On Windows, OpenMP support is disabled since rtools decided to compile fftw without OpenMP support.
- On Windows, OpenMP support is disabled since rtools' fftw is compiled without OpenMP support.
- On Linux and MacOS the build scripts should automatically detect whether OpenMP support is available.

By default, most compiler setups do not make use of AVX to increase portability of the binary. If you are an R user that has a CPU supporting AVX and want to make use of it, you might need to manually enable compiler flags to let R know about it, and install the package from source (so that it gets compiled on your machine). One way to enable the flags is to create a file `~/.R/Makevars` with the following content:
Expand Down Expand Up @@ -63,7 +63,7 @@ Note that the installation process might fail if the package needs to be compile

## Example

This is a basic example that invokes the fCWT library to calculate the continuous wavelet transform and plot the result.
This is a basic example where the continuous wavelet transform of a sample signal is calculated. The result is inspected and plotted.

```{r example}
library(fCWTr)
Expand All @@ -84,17 +84,18 @@ output <-
freq_scale = "linear"
)
# The result is basically a numeric matrix with time and frequency dimension
# The result is a numeric matrix with time and frequency dimension
dim(output)
# Some meta data is recorded too
output
```

The result can be converted into a data frame if need be:
The result can also be converted into a data frame:

```{r example_df}
head(as.data.frame(output), 10)
as.data.frame(output) |>
head(10)
```

We can also directly plot the resulting scalogram:
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ noise-resistant time–frequency analysis. Nat Comput Sci 2, 47–58 (2022).
instruction set
- Optional: OpenMP (and fftw built with [OpenMP
support](https://www.fftw.org/doc/Usage-of-Multi_002dthreaded-FFTW.html))
- On Windows, OpenMP support is disabled since rtools decided to
compile fftw without OpenMP support.
- On Windows, OpenMP support is disabled since rtools’ fftw is
compiled without OpenMP support.
- On Linux and MacOS the build scripts should automatically detect
whether OpenMP support is available.

Expand Down Expand Up @@ -83,8 +83,8 @@ system.

## Example

This is a basic example that invokes the fCWT library to calculate the
continuous wavelet transform and plot the result.
This is a basic example where the continuous wavelet transform of a
sample signal is calculated. The result is inspected and plotted.

``` r
library(fCWTr)
Expand All @@ -105,7 +105,7 @@ output <-
freq_scale = "linear"
)

# The result is basically a numeric matrix with time and frequency dimension
# The result is a numeric matrix with time and frequency dimension
dim(output)
#> [1] 137 200

Expand All @@ -125,10 +125,11 @@ output
#> 0.000 0.000 0.000 0.003 0.001 0.064 6671
```

The result can be converted into a data frame if need be:
The result can also be converted into a data frame:

``` r
head(as.data.frame(output), 10)
as.data.frame(output) |>
head(10)
#> time_index time freq value
#> 1 0 0.000 [s] 2100 [Hz] NA
#> 2 1 0.001 [s] 2100 [Hz] NA
Expand Down

0 comments on commit 78f3cbd

Please sign in to comment.