I am tying to get around how you will multiply the values in 2 arrays (as an input) to get an output. The problem I have is the how to increment the loops to achieve the task shown below
#include <iostream>
using namespace std;
main()
{
int* filter1, *signal, fsize1 = 0, fsize2 = 0, i = 0;
cout << " enter size of filter and signal" << endl;
cin >> fsize1 >> fsize2;
filter1 = new int [fsize1];
signal = new int [fsize2];
cout << " enter filter values" << endl;
for (i = 0; i < fsize1; i++)
cin >> filter1[i];
cout << " enter signal values" << endl;
for (i = 0; i < fsize2; i++)
cin >> signal[i];
/*
The two arrays should be filled by users but use the arrays below for test:
int array1[6] = {2, 4, 6, 7, 8, 9};
int array2[3] = {1, 2, 3};
The output array should be
array3[8]= {1 * 2, (1 * 4 + 2 * 2), (1 * 6 + 2 * 4 + 3 * 2), (1 * 7 + 2 * 6 + 3 * 4), (1 * 8 + 2 * 7 + 3 * 6), (1 * 9 + 2 * 8 + 3 * 7), (2 * 9 + 3 * 8), 3 * 9}
*/
return 0;
}
This is part of a bigger task concerning filter of a sampled signal but it is this multiplication that I cant get done.