{"id":16201021,"url":"https://github.com/lin-jun-xiang/python-fourier-transform","last_synced_at":"2025-04-07T18:16:35.603Z","repository":{"id":137755269,"uuid":"512363756","full_name":"Lin-jun-xiang/python-fourier-transform","owner":"Lin-jun-xiang","description":"Python 離散傅立葉轉換與可視化 (without any fft module)","archived":false,"fork":false,"pushed_at":"2023-03-08T09:46:29.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T18:16:31.622Z","etag":null,"topics":["fourier","fourier-transform","nufft","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Lin-jun-xiang.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,"publiccode":null,"codemeta":null}},"created_at":"2022-07-10T06:38:18.000Z","updated_at":"2023-05-10T09:09:15.000Z","dependencies_parsed_at":"2023-04-29T18:46:05.123Z","dependency_job_id":null,"html_url":"https://github.com/Lin-jun-xiang/python-fourier-transform","commit_stats":null,"previous_names":["lin-jun-xiang/python-fourier-transform"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lin-jun-xiang%2Fpython-fourier-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lin-jun-xiang%2Fpython-fourier-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lin-jun-xiang%2Fpython-fourier-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lin-jun-xiang%2Fpython-fourier-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lin-jun-xiang","download_url":"https://codeload.github.com/Lin-jun-xiang/python-fourier-transform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704572,"owners_count":20982298,"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":["fourier","fourier-transform","nufft","python"],"created_at":"2024-10-10T09:35:16.773Z","updated_at":"2025-04-07T18:16:35.577Z","avatar_url":"https://github.com/Lin-jun-xiang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fourier-Transform\n* Visualize and analyze the fourier transform result.\n* Final project\n\n### Introduction\n\n* 用 Python 實現傅立葉正(逆)轉換，並可視化結果。\n* 傅立葉轉換目的 :了解原始訊號是由哪些頻率的cos,sin組成，將時域訊號轉換成頻域訊號觀看 (不同角度觀看數據)。\n  * 濾波處理 : 當時域訊號非常雜亂複雜時，可以先進行正轉換取得頻域訊號，並針對感興趣的部分篩選，例如: 留下分量大的訊號，將分量小的頻號排除，再進行反轉換為時域訊號。\n\n\u003cp align=\"center\"\u003e\n\u003cimage SRC=\"https://user-images.githubusercontent.com/63782903/178134956-92ebace4-87ab-49cf-95be-2b5e27294c23.png\" width=50%/\u003e\n\u003c/p\u003e\n\n* 每個訊號都是sin, cos以不同頻率組成，因此FT轉換目的是要得知訊號由哪些頻率的sin, cos組成。\n\n* FT轉換後，大致上會得到實部 (cos) 跟虛部 (sin)，因此做圖因該分為實部與虛部來畫。\n\n* 如果signal裡面只含有cos訊號，則得到的FT頻域應當只含有實部，這也是在積分項`evev(cos)*odd(sin)`會為0的原因。\n\n\n### Method\n\n例子 - 時域訊號及頻域解析解如下:\n\u003cp align=\"center\"\u003e\n\u003cimage src=\"https://user-images.githubusercontent.com/63782903/178135616-c7633824-f789-456a-ae71-28b9a9242565.png\" width=50%/\u003e\n\n\n正轉換與逆轉換流程如下 (h為時域訊號；H為頻域訊號) :\n\n\u003cp align=\"center\"\u003e\n\u003cimage src=\"https://user-images.githubusercontent.com/63782903/178134447-04ee0eb7-9d92-4fac-8e15-51f91a8db4b2.png\" width=50%/\u003e\n\n\n### Results\n\n針對時域訊號進行不同採樣數量 (N=16, N=32, N=128)，並以不同採樣數量得數據進行正轉換，結果如下 :\n(時域訊號中的紅色點，為採樣點)\n\n可以發現 N=16 的轉換結果較為不同 (與解析解不同)，主要是採樣點不足 (dt \u003e 0.5) 導致 **映頻效應(Aliasing)**\n\n\u003cp align=\"center\"\u003e\n\u003cimage SRC=\"https://user-images.githubusercontent.com/63782903/178135213-1c4f6f25-38da-4927-a7b3-9d600c20efab.png\" WIDTH=50%/\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimage src=\"https://user-images.githubusercontent.com/63782903/178135316-912ea526-c3fa-48e5-866f-b0be944456da.png\" width=50%/\u003e\n\n逆轉換結果如下 : \n\u003cp align=\"center\"\u003e\n\u003cimage SRC=\"https://user-images.githubusercontent.com/63782903/178135427-0f64184a-33e1-4411-b0ae-375295f5b477.png\" WIDTH=50%/\u003e\n\n### Conclusion\n\n* 採樣頻率(fs)需大於等於訊號最大頻率的2倍，才能建立完整訊號\n* fs = 1/dt = N/T\n* 例子中的訊號其最大頻率為 1，因此 fs 需大於等於 24\n* 當 N = 16 時，不滿足條件，因此發生映頻效應\n* fs 太小將無法抓取高頻訊號 ! 會將高頻訊號誤認為低頻訊號\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flin-jun-xiang%2Fpython-fourier-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flin-jun-xiang%2Fpython-fourier-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flin-jun-xiang%2Fpython-fourier-transform/lists"}