MATLAB Answers

## How to plot bode plot from FFT data

Asked by SACHIN DEVASSY

### SACHIN DEVASSY (view profile)

on 30 Sep 2013
Latest activity Commented on by Arkadiy Turevskiy

### Arkadiy Turevskiy (view profile)

on 1 Oct 2013

Hi, I would like to get bode plot from FFT data. How do I convert the data obtained(complex values) so that it can be used by the 'bode' function in matlab.

Thanking you.

## 1 Answer

### Arkadiy Turevskiy (view profile)

Answer by Arkadiy Turevskiy

### Arkadiy Turevskiy (view profile)

on 30 Sep 2013

You need to create an frd object.

here is example code from doc page.

```% generate a frequency vector and response data
freq = logspace(1,2);
resp = .05*(freq).*exp(i*2*freq);
% Create a FRD model
sys = frd(resp,freq);
```

Now simply do

```bode(sys)
```

SACHIN DEVASSY

### SACHIN DEVASSY (view profile)

on 1 Oct 2013

Thanks Arkadiy for the reply. However, I am unable to understand how to make frd data from fft data. I got lets say ,following data points after doing fft [2+2j,1-3j,4, 5+4j]. How do i convert this into frd. Thanking you.

Arkadiy Turevskiy

### Arkadiy Turevskiy (view profile)

on 1 Oct 2013
```resp=[2+2j,1-3j,4, 5+4j];
freq= % enter the frequency values at which the corresponding fft
% values are obtained
sys=frd*resp,freq);
```

#### Join the 15-year community celebration.

Play games and win prizes!

Learn more

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

### MATLAB Academy

New to MATLAB?

Learn MATLAB today!