Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:54:39+00:00 2026-06-05T12:54:39+00:00

This is partly taken from the Matlab fft-documentation: Fs = 30; % Sampling frequency

  • 0

This is partly taken from the Matlab fft-documentation:

Fs = 30;                    % Sampling frequency
T = 1/Fs;                   % Sample time
L = 130;                    % Length of signal
t = (0:L-1)*T;              % Time vector

x = sin(2*pi*1*t);          % 1 Hz sinus

plot(real(ifft(abs(fft(x))))); % fft then ifft

% Fs = 30, L = 60 / 90 / 120 ... : ok
% Fs = 20, L = 60 / 80 / 100 ... : ok
% Fs = 30, L = 50 / 70 / 80 ... : not ok

It seems to me that whenever the length of the signal is a multiple of the sampling frequency, the sinusoid is reconstructed correctly (apart from some shift), e.g. here Fs = 30, L = 60:

enter image description here

However, if for example Fs = 30, L = 80 (not a multiple), the result looks odd:

enter image description here

Is this behaviour correct? Why is this happening and how can I avoid this? Just throw away some part of the signal such that the length “fits” the sampling frequency?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:54:41+00:00Added an answer on June 5, 2026 at 12:54 pm

    When you use the abs(fft()) in ifft, you are using only the amplitude of the signal and dropping the phase information, which is needed.

    Use the whole signal (removed abs):

    plot(real(ifft(fft(x)))); % fft then ifft
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've taken the existing code from this project , and very happy with it
This question is partly about delegates, and partly about generics. Given the simplified code:
Ok, so basically I have this part of the .htaccess partly working, but not
This is the first time I've used a 3rd party jar, but it seems
I'm planning to upload a billion records taken from ~750 files (each ~250MB) to
Following this article , I've been able to partly transpose a mySQL table. This
Thank you all ahead of time. This is my first time developing a jQuery
I apologise for the length of this problem, but I thought it important to
I'm building a controller which takes a request from a third party service. This
I'd like to do this: library(party) # cts <- ??? n <- c(50, 100,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.