{"id":23508603,"url":"https://github.com/fabnavarro/rwavelet","last_synced_at":"2025-06-16T00:09:19.670Z","repository":{"id":56935381,"uuid":"124140554","full_name":"fabnavarro/rwavelet","owner":"fabnavarro","description":"rwavelet: Wavelet Analysis","archived":false,"fork":false,"pushed_at":"2024-08-19T14:07:58.000Z","size":1004,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T16:46:48.355Z","etag":null,"topics":["machine-learning","r","regression","rstats","wavelet"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabnavarro.png","metadata":{"files":{"readme":"README.Rmd","changelog":"News.Rmd","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-06T21:25:06.000Z","updated_at":"2025-01-13T16:00:36.000Z","dependencies_parsed_at":"2024-08-19T16:39:14.405Z","dependency_job_id":null,"html_url":"https://github.com/fabnavarro/rwavelet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fabnavarro/rwavelet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabnavarro%2Frwavelet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabnavarro%2Frwavelet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabnavarro%2Frwavelet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabnavarro%2Frwavelet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabnavarro","download_url":"https://codeload.github.com/fabnavarro/rwavelet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabnavarro%2Frwavelet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260072806,"owners_count":22954926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","r","regression","rstats","wavelet"],"created_at":"2024-12-25T11:23:39.466Z","updated_at":"2025-06-16T00:09:19.635Z","avatar_url":"https://github.com/fabnavarro.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: gfm\n---\n```{r Setup, include=FALSE}\nlibrary(rwavelet)\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"inst/doc/readme_img/\"\n)\n```\n# rwavelet\n\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/rwavelet)](http://cran.r-project.org/package=rwavelet)\n![CRAN Downloads](https://cranlogs.r-pkg.org/badges/rwavelet)\n![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/rwavelet)\n\nWavelet Analysis\n\n## Download and Install\n\nInstall the devtools package if you haven't already.\n```{r, eval=FALSE}\ninstall.packages(\"devtools\")\n```\n\nTo install the development package, type the following at the R command line:\n```{r, eval=FALSE}\ndevtools::install_github(\"fabnavarro/rwavelet\")\nlibrary(rwavelet)\n```\n\nTo install the CRAN version of the package, type the following:\n```{r, eval=FALSE}\ninstall.packages(\"rwavelet\")\n```\n\n## General features\n\n* 1d, 2d and 3d MRA Forward/Inverse Wavelet Transforms Periodized Orthogonal (FWT_PO, IFWT_PO)\n* 1d, 2d tensor Forward/Inverse Wavelet Transform Periodized Orthogonal (FTWT_PO, ITWT_PO)\n* 1d, 2d Translation Invariant Forward/Inverse Wavelet Transform (FWT_TI, IWT_TI, also know as redundant wavelet transform, maximal overlap wavelet transform, undecimated wavelet transform or stationary wavelet transform)\n* Linear wavelet estimation/approximation (using 2 fold cross validation, CVLinear)\n* Non linear wavelet estimation/approximation (hard and soft thresholding, can be easily extended to other thresholding rules)\n* 1d Wavelet Block Thresholding estimation/approximation\n* ...\n\nTo obtain the complete list of package functions, simply type \n```{r, eval=FALSE}\nhelp(package = \"rwavelet\")\n```\n\n## Getting Started\n\nHere is an example of denoising of an experimental nuclear magnetic resonance (NMR) spectrum. We start by loading the data:\n```{r}\ndata(\"RaphNMR\")\nY \u003c- RaphNMR\nn \u003c- length(Y)\nt \u003c- seq(0, 1, length = n)\n```\n\nThen we specify the coarse decomposition scale $j_0$, the wavelets we want to use (here, Symmlet with 6 vanishing moments) and we perform a fast wavelet transform to get the noisy wavelet coefficients (Ywd):\n```{r}\nj0 \u003c- 0\nJ \u003c- log2(n)\nqmf \u003c- MakeONFilter('Symmlet', 6)\nYwd \u003c- FWT_PO(Y, j0, qmf)\nYwnoise \u003c- Ywd\n```\n\nWe estimate $\\sigma$ the standard deviation of the noise using the maximum absolute deviation (with only the finest scale coefficients). We apply a hard thresholding rule (with a universal threshold) to the coefficient estimators and obtain the estimator by applying an inverse transform:\n```{r}\nhatsigma \u003c- MAD(Ywd[(2^(J-1)+1):2^J])\nlambda \u003c- sqrt(2*log(n))*hatsigma\nYwd[(2^(j0)+1):n] \u003c- HardThresh(Ywd[(2^(j0)+1):n], lambda)\nfhat \u003c- IWT_PO(Ywd, j0, qmf)\n```\n\nFinally, we plot the resulting estimator:\n```{r, NMR, fig.width=8, fig.height=5} \npar(mfrow=c(2,2), mgp = c(1.2, 0.5, 0), tcl = -0.2,\n    mar = .1 + c(2.5,2.5,1,1), oma = c(0,0,0,0))\nplot(t,Y,xlab=\"\", ylab=\"\", main=\"Observations\")\nplot(t,Y,xlab=\"\", ylab=\"\", main=\"Observations and Estimator\")\nmatlines(t, fhat, lwd=2, col=\"blue\", lty=1)\nplot(Ywnoise, ylim=c(-20, 20), xlab=\"\", ylab=\"\", main = \"Noisy Coefficients\")\nmatlines(rep(lambda, n), lwd=2,col=\"red\",lty=1)\nmatlines(-rep(lambda, n), lwd=2,col=\"red\",lty=1)\nplot(Ywd, ylim=c(-20,20), xlab=\"\", ylab=\"\", main = \"Estimated Coefficients\")\n```\n\nSee the [package vignette](http://fnavarro.perso.math.cnrs.fr/rpackage/rwaveletvignette.html) or [documentation](https://fnavarro.perso.math.cnrs.fr/rpackage/rwavelet.pdf) for more details.\nYou could also build and see the vignette associated with the package using the following lines of code\n```{r, eval=FALSE}\ndevtools::install_github(\"fabnavarro/rwavelet\", build_vignettes = TRUE)\nlibrary(rwavelet)\n```\n\nThen, to view the vignette\n```{r, eval=FALSE}\nvignette(\"rwaveletvignette\")\n```\n\n## How to cite\n```{r Cite me}\ncitation(\"rwavelet\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabnavarro%2Frwavelet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabnavarro%2Frwavelet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabnavarro%2Frwavelet/lists"}