Thread Subject: ifft

Subject: ifft

From: Monica Carlier

Date: 28 Oct, 2009 20:05:21

Message: 1 of 2


Hi All

I need to read a signal and modify it in the frequency domain, and then come back to the time domain and graph the new signal. I have problems because the signal is distorted and the graph is just a line. What could be the problem?

This is the code I have:
x=wavread('file.wav');
y=fft(x);
y1=abs(y);
y2=unwrap(angle(y));
y3=medfilt1(y1);
y4=complex(y3,y2);
y5=ifft(y4, 'symmetric');
plot(y5);

Please advise,

Ceci

Subject: ifft

From: NZTideMan

Date: 28 Oct, 2009 20:23:09

Message: 2 of 2

On Oct 29, 9:05 am, "Monica Carlier" <carliermon...@gmail.com> wrote:
> Hi All
>
> I need to read a signal and modify it in the frequency domain, and then come back to the time domain and graph the new signal. I have problems because the signal is distorted and the graph is just a line. What could be the problem?
>
> This is the code I have:
> x=wavread('file.wav');
> y=fft(x);
> y1=abs(y);
> y2=unwrap(angle(y));
> y3=medfilt1(y1);
> y4=complex(y3,y2);
> y5=ifft(y4, 'symmetric');
> plot(y5);
>
> Please advise,
>
> Ceci

But you've converted the complex numbers y into amplitude and phase,
whereas complex wants real and imaginary parts.
Here is the first line of help complex:
COMPLEX Construct complex result from real and imaginary parts.

So, instead of using complex, you should convert using:
y4=y3.*exp(i*y2);

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com