{"id":26667289,"url":"https://github.com/vargalaszlo87/fgen","last_synced_at":"2025-03-25T19:36:54.010Z","repository":{"id":204640297,"uuid":"712321160","full_name":"vargalaszlo87/fGen","owner":"vargalaszlo87","description":"function generator in C","archived":false,"fork":false,"pushed_at":"2024-01-30T13:49:02.000Z","size":21,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-31T13:53:11.212Z","etag":null,"topics":["c","csv","function-generator","quickbuild","simulation","sine-wave","sinewave","waveform","waveform-generator"],"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/vargalaszlo87.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-10-31T08:34:41.000Z","updated_at":"2024-01-31T13:53:11.212Z","dependencies_parsed_at":null,"dependency_job_id":"1acd9b78-9212-40b6-8e98-b9c7e100183a","html_url":"https://github.com/vargalaszlo87/fGen","commit_stats":null,"previous_names":["vargalaszlo87/fgen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vargalaszlo87%2FfGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vargalaszlo87%2FfGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vargalaszlo87%2FfGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vargalaszlo87%2FfGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vargalaszlo87","download_url":"https://codeload.github.com/vargalaszlo87/fGen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245532628,"owners_count":20630959,"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":["c","csv","function-generator","quickbuild","simulation","sine-wave","sinewave","waveform","waveform-generator"],"created_at":"2025-03-25T19:36:53.528Z","updated_at":"2025-03-25T19:36:54.004Z","avatar_url":"https://github.com/vargalaszlo87.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# fGen\n\nThis is an user friendly function generator in C. You can simple way generate different waveforms and do operations with them.\n\n\n\n\n## Features\n\n\n**`SIMULATION`**\n- You can set the **simulation time**\n- You can add the number of **simulaton steps**\n\n**`WAVEFORMS`**\n\n- **periodic** signals: *sine, square, triangle* \n- **non-periodic** signals: *square root, Log, Log2, Log10, Lin*\n\n\n**`OPERATIONS`**\n- **math:** *add, sub, mul, div*\n\n**`OUTPUTS`**\n- **showWaves:** *makes a list with two columns in console*\n- **writeCSV:** *makes a CSV file with content of \"showWaves\"*\n- **writeHeader:** *makes a standard C header file with two arrays*\n\n\n## Getting started\n\nTo use this repository, you will need:\n- GCC (or similar C compiler)\n\n#### Clone source\n\n```\ngit clone https://github.com/vargalaszlo87/fGen.git\n```\n\n#### Quick build\n\nIf you use **`Windows`**\n\n:red_circle: Important! Check the `gcc --help` command in your Command Prompt. If it doesn't work you need add GCC to system variable (PATH).\n```\ninstall.bat\n```\n\nIf you use **`Linux`**\n\n```\ninstall.sh\n```\n\n#### Self compiling\nIf you use **`Windows`**\n\n```\ngcc -c src/main.c -o build/main.o -I\"include\"\ngcc -c src/signals.c -o build/signals.o -I\"include\" \ngcc -c src/operands.c -o build/operands.o -I\"include\" \ngcc -c src/outputs.c -o build/outputs.o -I\"include\" \ngcc -c src/adjust.c -o build/adjust.o -I\"include\"\ngcc -c src/create.c -o build/create.o -I\"include\"\ngcc build/main.o build/signals.o build/outputs.o build/adjust.o build/create.o -o bin/fGen.exe\n```\n\nIf you use **`Linux`**\n\n```\ngcc -c src/main.c -o build/main.o -I\"include\" -lm\ngcc -c src/signals.c -o build/signals.o -I\"include\" -lm\ngcc -c src/operands.c -o build/operands.o -I\"include\" -lm\ngcc -c src/outputs.c -o build/outputs.o -I\"include\" -lm\ngcc -c src/adjust.c -o build/adjust.o -I\"include\" -lm\ngcc -c src/create.c -o build/create.o -I\"include\" -lm\ngcc build/main.o build/signals.o build/outputs.o build/adjust.o build/create.o -o bin/fGen\n```\n## Usage\n\nInsert your headers:\n```C\n#include \"fgen.h\"\n```\nCreate a simulation:\n```C\nstruct generator g;\ng.step = 10000;               /* number of steps */\ng.simulationTime = 0.1755;    /* time in seconds */\n```\nCreate a waveform:\n```C\nstruct waveform signal;\nsignal.amplitude = 230;       /* set amplitude */\nsignal.frequency = 120;       /* set frequency */\nmakeSine(\u0026g, \u0026signal);\n```\nGenerate an output:\n```C\nshowWaves(\u0026signal);\n```\n\n## Example\n\nsrc/main.c file:\n\n```C\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\n#include \"fgen.h\"\n\nint main(int argc, char *argv[]) {\n\t\n\t// create a simulation\n\tstruct generator g;\n\tg.step = 10000;\n\tg.simulationTime = 0.1755;\n\t\n\t// create a sine signal\n\tstruct waveform signal;\n\tsignal.amplitude = 230;\n\tsignal.frequency = 120;\n\tmakeSine(\u0026g, \u0026signal);\n\n\t// crate a sine noise-signal\n\tstruct waveform noise;\n\tnoise.amplitude = 23;\n\tnoise.frequency = 5000;\n\tmakeSine(\u0026g, \u0026noise);\n\n\t// create a ramp (sqrt function)\n\tstruct waveform ramp;\n\tmakeSqrt(\u0026g, \u0026ramp);\n\n\t// make an 'out' waveform\n\tstruct waveform out;\n\t\n\t// add two signals (out = signal + noise)\n\t// multiply two signals (out = out * ramp)\n\tout = addWaves(\u0026g, \u0026signal, \u0026noise);\n\tout = mulWaves(\u0026g, \u0026out, \u0026ramp);\n\n\t// write to stdout and CSV\n\tshowWaves(\u0026out);\n\twriteCSV(\u0026out);\t\n\t\t\n\treturn 0 ;\n}\n\n```\n## License\n\nDistributed under the [MIT](https://choosealicense.com/licenses/mit/) License. See `LICENSE.txt` for more information.\n\n\n\n\n## Contact\n\nVarga Laszlo - https://vargalaszlo.com - mail@vargalaszlo.com\n\nProject Link: https://github.com/vargalaszlo87/fGen\n\n[![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](http://vargalaszlo.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvargalaszlo87%2Ffgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvargalaszlo87%2Ffgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvargalaszlo87%2Ffgen/lists"}