{"id":20060346,"url":"https://github.com/fedecastellaro/hamming-window-for-signal-processing","last_synced_at":"2026-04-11T15:39:02.385Z","repository":{"id":196645309,"uuid":"430835242","full_name":"fedecastellaro/Hamming-window-for-signal-processing","owner":"fedecastellaro","description":"Hamming window algorithm for the Arduino environment or any microcontroller. Specially usefull in signal processing.","archived":false,"fork":false,"pushed_at":"2021-12-02T14:05:23.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"hamming","last_synced_at":"2025-01-12T22:12:57.234Z","etag":null,"topics":["arduino","c","cpp","esp32","hamming","hamming-window"],"latest_commit_sha":null,"homepage":"","language":"C++","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/fedecastellaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-11-22T19:15:28.000Z","updated_at":"2021-12-02T14:05:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"f999a845-7227-40dc-a25f-bd3447e9e126","html_url":"https://github.com/fedecastellaro/Hamming-window-for-signal-processing","commit_stats":null,"previous_names":["fedecastellaro/hamming-window-for-signal-processing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecastellaro%2FHamming-window-for-signal-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecastellaro%2FHamming-window-for-signal-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecastellaro%2FHamming-window-for-signal-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecastellaro%2FHamming-window-for-signal-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedecastellaro","download_url":"https://codeload.github.com/fedecastellaro/Hamming-window-for-signal-processing/tar.gz/refs/heads/hamming","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241488204,"owners_count":19970829,"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":["arduino","c","cpp","esp32","hamming","hamming-window"],"created_at":"2024-11-13T13:14:06.735Z","updated_at":"2025-12-31T01:06:30.345Z","avatar_url":"https://github.com/fedecastellaro.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hamming window for signal processing\nHamming window algorithm for the Arduino environment or any microcontroller. Specially usefull in signal processing.\n\n## Summary\n\n```cpp\n// Include the hamming header\n#include \"hamming.h\"\n\n/*Invoke an instance of the Hamming class. The only requirement is to declare the size of the window in which the signal is*/\n#define WINDOW_SIZE 1000\n\nHamming hamming_window(WINDOW_SIZE);\n\n/*Just to test it I'll be using a heavyside function. Here you can use whatever function you want*/\nfloat heavyside_function[WINDOW_SIZE];\n\n/*Then simply apply the window to the signal. Beware that all changes will be applied to the same array that you put as argument.*/\nhamming_window.applyWindow(heavyside_function);\n\n```\n\n## Window Function:\nWindows are mathematical functions frequently used in analysis and signal processing to avoid discontinuities at the beginning and end of analyzed blocks.\n\nIn signal processing, a window is used when the analysis focuses on a signal of voluntarily limited length. Indeed, a real signal has to be finite time; furthermore, a calculation is only possible from a finite number of points. To observe a signal in finite time, it is multiplied by a window function.\n\n## Hamming Function:\n\n### What is Hamming window used for?\nComputers can't do computations with an infinite number of data points, so all signals are \"cut off\" at either end. This causes the ripple on either side of the peak that you see. The hamming window reduces this ripple, giving you a more accurate idea of the original signal's frequency spectrum\n\n### Equation\n![equals1](https://latex.codecogs.com/png.image?\\dpi{110}\u0026space;\\bg_white\u0026space;H(n)\u0026space;=\u0026space;0.54\u0026space;\u0026plus;0.46\u0026space;\\cdot\u0026space;cos[(\\frac{2\\pi}{N})\\cdot\u0026space;n])\n\n## How to use:\nCopy the following files in your proyect directory:\n\n- hamming.h\n- hamming.cpp\n\nIn your code invoke a instance of the Hamming class. The only argument that is needed is the amount of samples in the windows where the signal in question is.\n\nIf your window has 1000 samples, the code we'll be:\n\n```cpp\n#define WINDOW_SIZE 1000\n\nHamming hamming_window(WINDOW_SIZE);\n```\n\nTo test it, we'll be applying the Hamming window to the positive part of a heavyside function:\n\n![heavyside](https://user-images.githubusercontent.com/41343686/143053367-646a841e-d28a-4709-ae46-d2e3c9c4f358.png)\n\nIn the code is represented like:\n\n```cpp\nfloat heavyside_function[WINDOW_SIZE];\n\nfor (int i = 0; i \u003c WINDOW_SIZE; i++)\n  heavyside_function[i] = 1;\n```\n\nThen we apply the Hamming window to the signal:\n\n```cpp\nhamming_window.applyWindow(heavyside_function);\n```\n\n**Beware that all changes will be applied to the same array that you put as argument.** Feel free to change this at will.\n\nAnd then graph the response:\n\n![Hamming signal](https://user-images.githubusercontent.com/41343686/143055453-394a9bf8-bb8f-4187-b8e5-73842fb995d7.png)\n\nTo finish, we can compare the response done by the microcontroller to what you can get with a python algorithm:\n\n![descarga (1)](https://user-images.githubusercontent.com/41343686/143062527-1147f811-42ff-46bc-91c9-40008dfaf0b6.png)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedecastellaro%2Fhamming-window-for-signal-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedecastellaro%2Fhamming-window-for-signal-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedecastellaro%2Fhamming-window-for-signal-processing/lists"}