How can I amplify and shift the phases of a complex waveform in MATLAB?

In summary, the conversation is discussing how to amplify and shift the phase of a complex waveform in MATLAB. The suggested method is to create an amplification waveform and then multiply it into the original waveform. There is also a discussion on the correct notation for multiplying a complex function by a phase factor and the potential use of convolution in the time domain. The topic of filtering and its relation to convolution is also mentioned.
  • #1
Natalie Johnson
40
0
I have a complex waveform in MATLAB that is of the form

y = A1 ei * 2 * π * f * t + Φ

I need to amplify each sample point of the waveform to an amplitude A2 and also for it to shift phase by φ. I therefore construct a complex waveform for amplification

y = (A2 / A1 ) ei+φ

Then with multiplication to give the amplified waveform

y = A2 ei*2*π*f*t+Φ ⋅ ei+φ

Is this correct?

Each point on the waveform must be multiplied by a different amplitude and phase. I have the amplitudes and phase in matricies so I am hoping if I just create an amplification waveform like above then I can just multiply into my waveform to get the final amplified waveform.
 
Physics news on Phys.org
  • #2
I am assuming you mean ##y=A_2e^{i(2\pi f t+\Phi)}e^{i\phi}##, right? If so, yes this is correct, you would multiply your original function through by ##\frac{A_2}{A_1}e^{i\phi}##.
I am not sure how Matlab deals with complex numbers, but if you are to multiply a complex function by ##e^{i\phi}##, it may be required to multiply by ##cos{\phi}+i sin{\phi}##, instead of ##e^{i\phi}##.. (This is the case in C for instance, when using standard libraries)
 
Last edited:
  • Like
Likes Natalie Johnson
  • #3
Your description is confusing to me.

You have a waveform digitised in the time domain. The discrete Fourier transform of that time series will be in the frequency domain, as the discrete phasors, or amplitude and phase of the spectrum.

Application of an amplitude variation to a waveform or spectrum is simple multiplication, but different phase for each point in the time domain is not. A phase shift in the time domain requires a single frequency be present or that the sample window is shifted. If you apply a different phase and amplitude change to each sample in the time domain you will be distorting the frequency axis of the spectrum, which is one weird way of generating a logarithmic frequency axis.

Filtering involves multiplying the spectrum of the waveform by the transfer function of the filter, then inverse Fourier transforming back to a time domain waveform.

If the filter transfer function was represented by a waveform in the time domain, then filtering of the signal waveform by filter waveform would be convolution in the time domain.

Natalie Johnson said:
Each point on the waveform must be multiplied by a different amplitude and phase. I have the amplitudes and phase in matricies so I am hoping if I just create an amplification waveform like above then I can just multiply into my waveform to get the final amplified waveform.
I believe you may be describing convolution in the time domain, not multiplication in the time domain.
Multiplication in the frequency domain is convolution in the time domain.

What are you actually trying to do? Filter, convolve or distort the frequency axis?
 
  • Like
Likes Natalie Johnson
  • #4
muscaria said:
I am assuming you mean ##y=A_2e^{i(2\pi f t+\Phi)}e^{i\phi}##, right? If so, yes this is correct, you would multiply your original function through by ##\frac{A_2}{A_1}e^{i\phi}##.
I am not sure how Matlab deals with complex numbers, but if you are to multiply a complex function by ##e^{i\phi}##, it may be required to multiply by ##cos{\phi}+i sin{\phi}##, instead of ##e^{i\phi}##.. (This is the case in C for instance, when using standard libraries)

Hi, Yes that is what I meant. I've tried both notation and they produce the same result in MATLAB.

But I am not getting even order harmonics with either method, my frequency is at 14 MHz. I get harmonics at 42 but not at 28 MHz. Can you advise?

Baluncore said:
Your description is confusing to me.

You have a waveform digitised in the time domain. The discrete Fourier transform of that time series will be in the frequency domain, as the discrete phasors, or amplitude and phase of the spectrum.

Application of an amplitude variation to a waveform or spectrum is simple multiplication, but different phase for each point in the time domain is not. A phase shift in the time domain requires a single frequency be present or that the sample window is shifted. If you apply a different phase and amplitude change to each sample in the time domain you will be distorting the frequency axis of the spectrum, which is one weird way of generating a logarithmic frequency axis.

Filtering involves multiplying the spectrum of the waveform by the transfer function of the filter, then inverse Fourier transforming back to a time domain waveform.

If the filter transfer function was represented by a waveform in the time domain, then filtering of the signal waveform by filter waveform would be convolution in the time domain.I believe you may be describing convolution in the time domain, not multiplication in the time domain.
Multiplication in the frequency domain is convolution in the time domain.

What are you actually trying to do? Filter, convolve or distort the frequency axis?
Hi, If I had this waveform
##y=A_1e^{i(2\pi f t+\Phi)}##
and wanted to adjust its phase by \phi, then
##y=A_1e^{i(2\pi f t+\Phi)}e^{i\phi}##

If I had the waveform
##y=A_1e^{i(2\pi f t+\Phi)}##
and wanted to adjust its amplitude to a specific value which is A_2, and also adjust the phase by \phi
then
##y=A_1e^{i(2\pi f t+\Phi)} (A_2 / A_1) e^{i\phi}##

The frequency domain looks okay after using this method, but for one issue...

I am not getting even order harmonics with either method, my frequency is at 14 MHz. I get harmonics at 42 but not at 28 MHz. Can you advise?
 
  • #5
Are you sure that such a harmonic exists in your signal? That's certainly possible.
 
  • #6
Natalie Johnson said:
I am not getting even order harmonics with either method, my frequency is at 14 MHz. I get harmonics at 42 but not at 28 MHz. Can you advise?
We have no idea of what your signals look like. Do you generate simulated plots in dBm that have an obvious computational noise floor? What is the spectrum of your input signal? and the output signal? How do they compare?

If you get the spectrum by taking an FFT without first applying a window function, your f2 may fall in a deep null. That is especially true with numerical simulation where signals are perfect sub-multiples of the time window.

You might test it by offsetting your 14 MHz input frequency by a few cycles in the time window, then seeing if you get a variation in harmonic amplitudes that is dependent on the slight frequency difference.
 
  • #7
You also haven't told us anything about the source of this signal. Is it synthetic or measured data of some kind? What phenomenon was it measuring or simulating (or was it purely concocted for testing purposes based on nothing physical)?

For example, if you look at the spectrum of a square wave, it shouldn't have any even harmonics, so maybe you are seeing proper behavior.
 

1. How can I amplify a complex waveform?

To amplify a complex waveform, you will need to use an electronic device called an amplifier. Amplifiers come in various types and sizes, but generally, you will need to connect your waveform source to the input of the amplifier and then connect the output of the amplifier to your output device, such as a speaker or recording device.

2. Can I amplify any type of waveform?

Yes, amplifiers can be used to amplify various types of waveforms, including complex ones. However, it is important to make sure that the amplifier you are using is suitable for the specific type of waveform you are trying to amplify.

3. What are the benefits of amplifying a complex waveform?

Amplifying a complex waveform can have several benefits, including increasing the volume or intensity of the signal, improving the signal-to-noise ratio, and allowing for better analysis and interpretation of the waveform.

4. Are there any risks associated with amplifying a complex waveform?

There are some risks associated with amplifying a complex waveform, such as introducing distortion or clipping if the amplifier is not properly calibrated or if too much gain is applied. It is important to use caution and carefully adjust the settings of the amplifier to avoid these risks.

5. What are some common techniques for amplifying a complex waveform?

There are several common techniques for amplifying a complex waveform, including using operational amplifiers (op-amps), transistors, or vacuum tubes. Each of these techniques has its own advantages and disadvantages, so it is important to consider the specific needs and requirements of your waveform when choosing an amplification method.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
867
Replies
2
Views
1K
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
17
Views
4K
Replies
3
Views
544
  • Programming and Computer Science
Replies
2
Views
715
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
917
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Back
Top