{"id":1774,"date":"2015-05-29T14:01:33","date_gmt":"2015-05-29T18:01:33","guid":{"rendered":"http:\/\/blog.originlab.com\/?p=1774"},"modified":"2019-10-16T13:18:46","modified_gmt":"2019-10-16T17:18:46","slug":"how-to-remove-dc-offset-before-performing-fft","status":"publish","type":"post","link":"https:\/\/blog.originlab.com\/ja\/how-to-remove-dc-offset-before-performing-fft","title":{"rendered":"How to Remove DC Offset before Performing FFT"},"content":{"rendered":"<p>Performing FFT to a signal with a large DC offset would often\u00a0result in a big impulse around frequency 0 Hz, thus masking out the signals of interests with relatively small amplitude.<\/p>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1987\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_10.png\" alt=\"Remove_DC_Offset_Blog_10\" width=\"571\" height=\"522\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_10.png 571w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_10-300x274.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/a><\/p>\n<p>Origin provides two methods to remove DC offset from the original signal before performing FFT:<\/p>\n<ul>\n<li>Using FFT High-Pass Filter<\/li>\n<li>Subtracting the Mean of Original Signal<\/li>\n<\/ul>\n<p>Note that these two methods can get the same result. You can also not filter the input, but set zero to the zero frequency point for FFT result.<\/p>\n<h4><span style=\"color: #0000ff;\">Using FFT High-Pass Filter<\/span><\/h4>\n<p>Any DC bias on the signal will show up in the frequency domain as amplitude at zero Hz, by setting the\u00a0cutoff frequency to be zero DC offset can be filtered. Steps are as following:<\/p>\n<ol>\n<li>Import the fftfilter2.dat under Origin exe\\Samples\\Signal Processing\\ folder.<\/p>\n<\/li>\n<li>\n<p>Highlight the source signal column <em>Amplitude<\/em>, and select menu <b>Analysis: Signal Processing: FFT Filters<\/b>.<\/p>\n<\/li>\n<li>\n<p>In the pop-up dialog, choose <b>High Pass<\/b> for <b>Filter Type<\/b>, uncheck <b>Auto\u00a0<\/b>checkbox to\u00a0set <b>Cutoff Frequency<\/b> to zero and clear the <b>Keep DC offset<\/b> check-box.<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1979\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_07.png\" alt=\"Remove_DC_Offset_Blog_07\" width=\"910\" height=\"458\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_07.png 910w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_07-300x151.png 300w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\" \/><\/a><\/p>\n<ol>\n<li>Click <strong>OK<\/strong> button to get the result without DC offset.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1980\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_08.png\" alt=\"Remove_DC_Offset_Blog_08\" width=\"467\" height=\"436\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_08.png 467w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_08-300x280.png 300w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #0000ff;\">Subtracting the Mean of Original Signal<\/span><\/h4>\n<ol>\n<li>Now we have\u00a0the original signal stored in column B (<em>Amplitude)<\/em>. Hold Ctrl + D to\u00a0add a new column C for storing DC offset removed signal and input\u00a0<em>DC Offset Removed\u00a0<\/em>as\u00a0<strong>Long Name<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Highlight column C, and select <b>Set Column Values<\/b> from the context menu to bring up the <b>Set Values<\/b> dialog.<\/p>\n<\/li>\n<li>\n<p>In <b>Before Formula Scripts<\/b> panel of the <b>Set Values<\/b> dialog, put the script:<\/p>\n<\/li>\n<\/ol>\n<pre class=\"lt\">stats col(b);<\/pre>\n<p>Then in the column formula text box, fill column C using the formula:<\/p>\n<pre class=\"lt\">col(b)-stats.mean<\/pre>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1779\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_03.png\" alt=\"Remove_DC_Offset_Blog_03\" width=\"507\" height=\"368\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_03.png 507w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_03-300x218.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/a><\/p>\n<ol>\n<li>Column C is the result without DC offset.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1984\" src=\"http:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_09.png\" alt=\"Remove_DC_Offset_Blog_09\" width=\"395\" height=\"371\" srcset=\"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_09.png 395w, https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/03\/Remove_DC_Offset_Blog_09-300x282.png 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #339966;\">Tips:\u00a0<\/span><\/strong><\/p>\n<p>If you need to get the DC offset, open the dialog mentioned in method one, then use the low-pass filter, and set <b>Cutoff Frequency<\/b> to zero, or use the Mean function to calculate the mean of the signal:<\/p>\n<pre class=\"lt\">DCOffset = Mean(col(B));<\/pre>","protected":false},"excerpt":{"rendered":"<p>Performing FFT to a signal with a large DC offset &hellip; <\/p>","protected":false},"author":24,"featured_media":11012,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3,4],"tags":[],"class_list":["post-1774","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-handling","category-data-analysis"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7DvU2-sC","jetpack_likes_enabled":true,"jetpack_featured_media_url":"https:\/\/blog.originlab.com\/wp-content\/uploads\/2015\/05\/FB_blog_DCoffset.png","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/1774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/comments?post=1774"}],"version-history":[{"count":21,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/1774\/revisions"}],"predecessor-version":[{"id":11333,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/posts\/1774\/revisions\/11333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/media\/11012"}],"wp:attachment":[{"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/media?parent=1774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/categories?post=1774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.originlab.com\/ja\/wp-json\/wp\/v2\/tags?post=1774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}